overriding GetPlayerPos seems way simpler, and way shorter.
Simba Code:
var lastSurge:Int64;
function TSPSArea.GetPlayerPos(): TPoint; override;
begin
Result := Inherited();
// do stuff bellow here, for example..:
if (GetTickCount64() - lastSurge > 3000) and //as this method is called many times, try to make sure we don't do it again while in this area.
PointInBox(Result, TBox([210,180,270,230])) then //only use surge if we are in this area
begin
//do your spellcast(s) here:
PressKey(surgeSlot); //or whatever..
//log it
lastSurge := GetTickCount64();
end;
end;
Also, this is untested, but the concept should work.. might have to fix it up tho..
Tho I am not sure why you wanna cast it while walking anyway, or if that is what you are actually trying to do.. But whatever..
/out