I've made a script for a Facebook game called 'Ninja Saga' where the script allows for quick casting of jutsus and talents.
And I've added a variable called ScriptStasis where if its 1, the script would go into stasis (duh),and that's where sh*t hits the fan hard.
For some unknown reason, since I've added If statements on each auto cast function to check for ScriptStasis, the script would acknowledge its value, but run the function INFINITELY,even though the purpose of ScriptStasis is to allow me to use the key as intended. Autohotkey even warned me that the script sent 71 hotkeys in the last 1129ms.
Here's the code for anyone who would like to help me:
Code: Select all
#CommentFlag ==>
#SingleInstance FORCE
#MaxThreadsPerHotkey 1
CoordMode, Mouse, Screen
ScriptStasis := 0
==> //-----Actions-----//
Jutsu_1()
{
If ScriptStasis = 0
{
ControlClick, x484 y489, Facebook Gameroom
} else
{
Send, 1
}
}
Jutsu_2()
{
If ScriptStasis = 0
{
ControlClick, x525 y489, Facebook Gameroom
} else
{
Send, 2
}
}
Jutsu_3()
{
If ScriptStasis = 0
{
ControlClick, x567 y489, Facebook Gameroom
} else
{
Send, 3
}
}
Jutsu_4()
{
If ScriptStasis = 0
{
ControlClick, x606 y489, Facebook Gameroom
} else
{
Send, 4
}
}
Jutsu_5()
{
If ScriptStasis = 0
{
ControlClick, x744 y489, Facebook Gameroom
} else
{
Send, 5
}
}
Jutsu_6()
{
If ScriptStasis = 0
{
ControlClick, x784 y489, Facebook Gameroom
} else
{
Send, 6
}
}
Jutsu_7()
{
If ScriptStasis = 0
{
ControlClick, x824 y489, Facebook Gameroom
} else
{
Send, 7
}
}
Jutsu_8()
{
If ScriptStasis = 0
{
ControlClick, x865 y489, Facebook Gameroom
} else
{
Send, 8
}
}
Talent_1()
{
If ScriptStasis = 0
{
ControlClick, x654 y251, Facebook Gameroom
} else
{
Send, Numpad1
}
}
Talent_2()
{
If ScriptStasis = 0
{
ControlClick, x616 y289, Facebook Gameroom
} else
{
Send, Numpad2
}
}
Talent_3()
{
If ScriptStasis = 0
{
ControlClick, x616 y333, Facebook Gameroom
} else
{
Send, Numpad3
}
}
Talent_4()
{
If ScriptStasis = 0
{
ControlClick, x654 y369, Facebook Gameroom
} else
{
Send, Numpad4
}
}
Talent_5()
{
If ScriptStasis = 0
{
ControlClick, x695 y369, Facebook Gameroom
} else
{
Send, Numpad5
}
}
Talent_6()
{
If ScriptStasis = 0
{
ControlClick, x732 y333, Facebook Gameroom
} else
{
Send, Numpad6
}
}
Talent_7()
{
If ScriptStasis = 0
{
ControlClick, x732 y289, Facebook Gameroom
} else
{
Send, Numpad7
}
}
Talent_8()
{
If ScriptStasis = 0
{
ControlClick, x695 y251, Facebook Gameroom
} else
{
Send, Numpad8
}
}
AutoOk()
{
If ScriptStasis = 0
{
ControlClick, x763 y499, Facebook Gameroom
} else
{
Send, 0
}
}
MissionOk()
{
If ScriptStasis = 0
{
ControlClick, x971 y449, Facebook Gameroom
} else
{
Send, -
}
}
Separateddddddd()
{
Suspend
ToolTip % A_IsSuspended ? "Script suspended" : "Script reenabled"
return
}
==> //-----Keybinds-----//
1::Jutsu_1()
2::Jutsu_2()
3::Jutsu_3()
4::Jutsu_4()
5::Jutsu_5()
6::Jutsu_6()
7::Jutsu_7()
8::Jutsu_8()
0::AutoOk()
-::MissionOk()
Numpad1::Talent_1()
Numpad2::Talent_2()
Numpad3::Talent_3()
Numpad4::Talent_4()
Numpad5::Talent_5()
Numpad6::Talent_6()
Numpad7::Talent_7()
Numpad8::Talent_8()
F1::
ScriptStasis:=!ScriptStasis
Tooltip, %ScriptStasis%
Sleep, 250
Tooltip
return
ESC::
Suspend
ExitApp