Key binds in scripts - specifically pausing / resuming a script

bowie

Senior Member
Well, I've just returned to ISXEQ2 but I have lost all my old scripts that I had written. Can someone enlighten me as to how to assign a key to a function?

Specifically, I am trying to assign my F11 key to pausing EQ2bot. I have tried adding this to "function main" but it doesn't work.

Code:
	bind PauseBot:Set[TRUE] "F11"
	bind ResumeBot:Set[TRUE] "F12"
 

Kannkor

Ogre
I do mine a little different.. but this may give you the code you need.
I use mine as a toggle.

In main..
Code:
squelch bind -press TogglePause f11 Script[ui]:ExecuteAtom[TogglePause]
Then the atom..
Code:
atom TogglePause()
{
	if ${UIElement[${CmdBoxPauseBotID}].Visible}
		UIElement[${CmdBoxPauseBotID}]:LeftClick
	elseif ${UIElement[${CmdBoxResumeBotID}].Visible}
		UIElement[${CmdBoxResumeBotID}]:LeftClick
}
 

bowie

Senior Member
Not working for me Kannkor.

Code:
echo ${CmdBoxPauseBotID}
shows
Code:
NULL
Is there an easier way? something like....

Code:
bind F11 script[eq2bot]:pause
 

bowie

Senior Member
OK..this is what I have tried so far with no success:

Code:
function main()
	bind -press EQ2Pause "F10" "script[eq2bot]:pause"
	bind -press EQ2Resume "F11" "script[eq2bot]:resume"
	squelch bind -press TogglePause F12 Script[ui]:ExecuteAtom[TogglePause]
Code:
atom TogglePause()
{
	if ${UIElement[EQ2 Bot].FindUsableChild[Pause EQ2Bot,commandbutton].Visible}
		UIElement[EQ2 Bot].FindUsableChild[Pause EQ2Bot,commandbutton]:LeftClick
	elseif if ${UIElement[EQ2 Bot].FindUsableChild[Resume EQ2Bot,commandbutton].Visible}
		if ${UIElement[EQ2 Bot].FindUsableChild[Resume EQ2Bot,commandbutton].Visible}:LeftClick
}
Neither F10, F11 or F12 work :/

[EDIT]
Also tried :

Code:
	bind -press "F10" "script[eq2bot]:pause"
	bind -press "F11" "script[eq2bot]:resume"
and...
Code:
	bind -press F10 "script[eq2bot]:pause"
	bind -press F11 "script[eq2bot]:resume"
Got that from here http://www.lavishsoft.com/wiki/index.php/ObjectType:script:

Code:
Methods

End: Ends execution of this script
QueueCommand[command]: Inserts a command in the script's command queue
Squelch: Squelches most output from this script (excluding most errors and generally excluding Echo)
Unsquelch: Unsquelches
Pause: Pauses this script
Resume: Resumes this script
ExecuteAtom[name,...]: Executes an atom in script-scope with the given name. Any extra parameters are passed as parameters to the atom.
EnableProfiling: Enables script profiling. Debugging must be turned on to enable.
DisableProfiling: Disables script profiling.
DisableDebugging: Disables debugging.
DumpStack: Dumps the current stack into the console.
DumpProfiling: Dumps the entire script into the console.
EnableDebugLogging[filename]: Enables full debug logging to file
DisableDebugLogging: Disables full debug logging
[edit]
Examples

[edit]
Display if a script is running
echo ${Script[VentriloHUD](exists)}
Output
TRUE
[edit]
End a script
Script[VentriloHUD]:End
Script:End
Note: When used as a command within a script will end the script
 
Last edited:

bowie

Senior Member
OK..after a lot of trial and error I got it to work. For anyone encountering the same problem:-

Code:
function main()
{
	bind -press Pause F10 Script[eq2bot]:Pause
	bind -press Resume F11 Script[eq2bot]:Resume
}
 
Top Bottom