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



×
×
  • 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.