SRL Archive - First Scripts

First script [07 Smart] prayer flicking


samerdl

2013-03-26 08:23:22


program PrayerFlicker;
{$DEFINE SMART8}
{$i SRL/SRL.simba}


procedure DoPrayer;
begin
GameTab(tab_Prayer);
writeln ('ClickingPray');
MouseBox(680,340,680,340,1);
writeln ('Ficking!');
Wait(750);
MouseBox(680,340,680,340,1);
writeln ('WaitingPRocess');
Wait(1000);
end;

begin
SetUpSRL;
DoPrayer;
Repeat
DoPrayer;
until(InvFull);
end.

Prayer Flicking is the process of turning on Melee prayer a bit before he npc attacks you and turning it off right away when its done, it doesn't give infinite prayer but it does reduce the damage you take and extends your prayer usage..

Obviously this script is trash because i could never really manage to make it work perfectly the way i want it to be.. Is there any special feature in simba that recognizes npc attacks i can use or is it all about timing?.

Anyway, simple script, clicks melee pray in smart client, waits clicks it off and waits longer and then does it again, repeat till inventory is full which is never going to happen :p, after npc is dead i disable smart with pray off and get ready to attack next and turn smart back on.. Good idea/stupid idea?.. my first script need to add mouse randomness to coordinates

Hopefully some pro scripter makes a flawless prayer flicker someday

pija

2013-04-01 09:00:48


procedure MeleeFlick(firstwait: integer);
var
desynch, des1, des2, waittime1, waittime2, randomwait1, randomwait2: integer;
begin
waittime2 := TICK;
waittime1 := TICK * MSPEED;
randomwait1 := waittime1;
randomwait2 := waittime2;
des1 := 0;
desynch := 0;
writeln('Flicking');
wait(firstwait * TICK)
repeat
begin
des2 := randomrange( - 100, 100) - desynch;
randomwait2 := waittime2 + des2;
des1 := random(200);
randomwait1 := waittime1 - randomwait2 + des1;
ClickMouse2(mouse_left);
wait(randomwait2);
ClickMouse2(mouse_left);
desynch := desynch - (2400 - randomwait1 - randomwait2);
wait(randomwait1);
end;
until (not InCombat)
The constant TICK is 600, runescape works in ticks of 6 decimals of a second in duration. Your window to succesfully turn on a prayer is of 600 miliseconds. You must click on the prayer the tick before the one where the enemy launches his attack, the prayer will be on a queue and will be active next tick. As soon as the prayer is active you can deactivate it, the deactivation will be put on a queue and deactivated next tick.
The above implementation is not perfect, follow it by paper to understand what it is doing, modify the parameters of randomrange to see what happens when the random wait times are very short or very high.

My brief description of what it does is the following, clicks, waits approximately 2400 miliseconds, then clicks and waits 600 miliseconds.
The waiting times are randomized and it will never desynch.

If you want your bot to click every time a second passes, you'll find that a function like this, after some time, will not be synchronized with your clock:


repeat
begin
click;
wait (1000-(randomrange(-100,100));
end;
until (false)

EDIT: Always randomize your ranges and waiting times, else, it is too detectable.

samerdl

2013-04-04 09:17:55

great post pija, wow thanks!! very informative, learned a lot! and will continue to learn more, would be wiser to even use case random for mouse clicks then it would make it better for training, i use this stuff mainly when i kill high level monsters

pija

2013-04-11 15:09:07

what do you mean by case random for mouse clicks?

Everything there is randomized, some srl functions, like mousebox or clickmouse2 already have randomization.