SRL Archive - First Scripts

chicken fighter


Feroc1ty

2011-02-24 11:34:13

removed.

Bobzilla69

2011-02-24 12:02:56

Script runs ok, i have a few recommendations

your fight detection i think need work. it will wait until the HP bar is gone before fighting again which is slow. also maybe have it fight a few chickens then pick up feathers instead of just fighting then picking up then fighting.

kitchenrange

2011-02-24 18:38:25

If the xp is on track, you can use that to count the chickens.

Find out how much xp is given for each chicken and then do some division.

I'm gonna post my WaitForFight function if you want to use it. It breaks instantly on death.

procedure WaitForFight;
var
Me : TMe;
i : integer;
begin
Flag;
Wait(RandomRange(200,300));
for i := 0 to 10 do
begin
if loggedin = false then Exit;
ClickContinue(True, False);
Wait(5);
Me := GetMe;
inc(i);
if Me.Interacting > 0 then i := 0;
end;
end;

Feroc1ty

2011-02-24 18:57:55

updated… now exp_priority makes your character focus on training and only loot when there's no mobs around, and the combat detection is MUCH cleaner, i guess me.infight is a terrible boolean that's probably used for logout detection rather than combat detection

edit2: updated it again, its pretty much complete i think, just need to figure out how to find object ID's since the last time i dumped get all objects it gave me like 2K of them.

edit3: a lot of new features.

Putnam

2011-02-25 21:30:57

I'm gonna test it later, you should add a LumbyWalk procedure. :) Makes it easier on people with armies.

Feroc1ty

2011-02-26 14:12:09

Script stopped working this morning as I updated SRL, gets stuck at login, instead of simply clicking "play", it clicks to world switcher tab and does nothing.

Feroc1ty

2011-02-27 15:20:04

huge script revamp, now runs pretty much flawlessly except for one error (script randomly stops working for some reason, usually 1-2+ hours in)

so if anyone could run it and help me figure out the reason why that would be cool…

Feroc1ty

2011-03-01 23:04:36

updated yet again… new this version:

shouldn't pick up raw chickens anymore (would do so if it couldn't find the text "attack chicken")
FinishFight function now works even with slow weapons (before was only accurate on fast weapons such as sling as that's the only thing that i tested)
should detect much quicker if another person clicked the chicken before you (before it sat around for around (flag+600ms) now it does so with only (flag+200ms)
found the glitch which caused the script to stop running (should work till your character gets an unsolvable random)
found a glitch where the distance between the pen and the character was incorrectly calculated (always returned 0)
now the script debug window shows your computer time next to all debug messages (still shows amount of time running through drawing on the client)

hope you guys like it i think it's pretty sexy so far, anyone have any suggestions on what improvements are to come?

superuser

2011-03-15 16:00:31

From: kitchenrange
If the xp is on track, you can use that to count the chickens.

Find out how much xp is given for each chicken and then do some division.

I'm gonna post my WaitForFight function if you want to use it. It breaks instantly on death.

procedure WaitForFight;
var
Me : TMe;
i : integer;
begin
Flag;
Wait(RandomRange(200,300));
for i := 0 to 10 do
begin
if loggedin = false then Exit;
ClickContinue(True, False);
Wait(5);
Me := GetMe;
inc(i);
if Me.Interacting > 0 then i := 0;
end;
end;


Your method is fine, however, it won't work if you are using summoning familiars while running the script. Also, TMe.Interacting breaks sometimes and therefore is not absolutely reliable. Below I wrote simple yet effective method for this:


procedure WaitForFight();
var
i: integer;
begin
i := 0;

repeat
Wait(250);

if (GetAnimation() <> -1) then
i := 0
else
Inc(i);
until (i > 4);
end;