macroing check
Posted: Sun Mar 09, 2008 9:53 am
does a script that opens a dialog gump and ask a question
(in order to check wheter player is away or not) exists?
(in order to check wheter player is away or not) exists?
https://www.forums.polserver.com/
Code: Select all
program SendMacroCheck( who )
const PATH_TO_CHECK := "check";
const ANSWERING_TIME := 120;
var proc := Start_Script(PATH_TO_CHECK, { who, GetPid() } );
var result := Wait_For_Event(ANSWERING_TIME);
if (result == 0)
// Timeout!
SysLog(who.name + " is AFK!");
// Kill's the gump off the player's screen.
proc.Kill();
else
// Answered in time, no reaction.
return 1;
endif
endprogram
Code: Select all
// Using yesNo gump (gumps-package) in this test
program check( params )
var who := params[1];
var pid := params[2];
var proc := GetProcess(pid);
// Return value does not matter; only the fact that player clicked.
YesNo(who, "Are you AFK?");
// Let timer script know that player clicked.
proc.SendEvent(1);
endprogram