Jump to content

Recommended Posts

  • Premium

Open game.py

Find for: "f4"

 

make a new line: self.onPressKeyDict[app.DIK_F5]        = lambda : self._FUNCTION_NAME_TO_CALL()

in this way you connected the function on the button (f5) pression.

 

After that we need to declare the function so you can do:

 

def _FUNCTION_NAME_TO_CALL(self)

    self.DO_WHAT_YOU_WANT()

Link to comment
Share on other sites

8 hours ago, lTz said:

Hi guys , today i have a request, ofc just if someone want to help :)

I want this command /test to open a script from game.py for ex the script is switchbot on f5 , and i want to open it with that command not with f5 , any solution will be welcome , ty again

Create new command in cmd.cpp and insert into cmd_general.cpp that command with ChatPacket:

ch->ChatPacket(CHAT_TYPE_COMMAND, "TestCommand");

And then move into game.py:

Find:

serverCommandList={

And insert into list:

"TestCommand"			: self.__TestCommandFunction,

And insert function at the end of game.py:

def __TestCommandFunction(self):
	import dbg
	dbg.LogBox("Command received!")

 

Hope I helped.

iBeast

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 1

      UI types and attributes

    2. 0

      ImperiaWorld2 - SpeedServer - Opening 03/05/2024 - NewSchool - New Graphics M2 1.0.4b Terrain depth - International

    3. 2

      Very strange bug, when creating new char

    4. 6

      Voooxy aka m2core.tech scammer

    5. 117

      Ulthar SF V2 (TMP4 Base)

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.