SRL Archive - SRL Archives

Fixed: SetFightMode;


Home

2006-09-27 13:51:30

[PHP]procedure SetFightMode(oFightMode: Integer);
begin
GameTab(1);
Wait(200 + Random(50));
if (oFightMode = 1) and (not (GetColor(590, 273) = 1579629)) then
Mouse(594, 283, 15, 8, True); // Attack
if (oFightMode = 2) and (not (GetColor(587, 325) = 1777020)) then
Mouse(612, 321, 15, 8, True); // Defensive
if (oFightMode = 3) and (not (GetColor(669, 271) = 1974408)) then
Mouse(690, 271, 15, 8, True); // Strength
if (oFightMode = 4) and (not (GetColor(619, 385) = 2106255)) then
Mouse(649, 379, 15, 8, True); // Auto Retaliate
end;[/PHP]

It should all Work…

~Home

warship45

2006-09-27 13:53:21

Nice i will try this in a min when i get back to my destop pc (on laptop) at moment

Yakman

2006-09-27 14:40:34

i just made 1 of these, except i made a whole new 1, not just fixed the old 1
heres mine, ill just test you 1 then edit this post
program fightmode;
{.include srl\srl.scar}
function SetFightMode2(fightmode:integer):boolean;
begin
gametab(1)
result:=false
case fightmode of
0:if(getcolor(584,262)=4803917)then begin result:=true mouse(584,258,50,30,true) end
1:if(getcolor(665,267)=5527896)then begin result:=true mouse(671,259,30,20,true) end
2:if(getcolor(583,312)=5527896)then begin result:=true mouse(581,311,50,30,true) end
3:if(getcolor(662,312)=4606281)then begin result:=true mouse(663,309,50,30,true) end
end
end;

begin
setupsrl
wait(3000)
if(setfightmode2(0))then
writeln('set to accurate')
else
writeln('didnt set to accurate')

if(setfightmode2(1))then
writeln('set to aggresive')
else
writeln('didnt set to aggresive')

if(setfightmode2(2))then
writeln('set to aggresive2/defencive')
else
writeln('didnt set to aggresive2/defencive')

if(setfightmode2(3))then
writeln('set to defencive')
else
writeln('didnt set to defencive (maybe it doesnt exist)')
end.

we should talk about what we're going to fix so we dont fix the same things

EDIT : i tested yours, it cant press the last option (normally defencive), instead it clicks autoretaliate, i know its intended but i dont think it should go there, there is already a procedure which sets autoretaliate on and off, if you put it into setfightmode, some scripts may stop working if when they want to press defencive, they turn autoretaliate off instead

tarajunky

2006-09-27 16:21:40

This type of procedure is pretty tricky, since different weapons have different options.

Some have 3, some have 4, plus you have unarmed. Some have two aggressive, some have controlled, etc.

Before I used to use the words 'accurate', 'aggressive', 'defensive' since they were right alongside the buttons. I thought this was the only reliable solution, but that's not really possible now unless you include a hover command to check the text.

I hope whoever attempts to write one of these makes it so that its compatible with all weapons and reliable.

Yakman

2006-09-27 16:25:59

well my one doesnt click the last option if it doesnt exist, also it returns if it was sucsessful, so people could do

if(not setfightmode(3))then
setfightmode(2)
that way it has to end up defencive

Cheesehunk

2006-09-27 18:32:55

Haha, I just made one as well.. :p

program New;
{.include SRL\SRL.scar}
var i : integer;

procedure SetFightMode2(oFightMode: Integer);
begin
GameTab(1);
Wait(200 + Random(50));
if (oFightMode = 1) and (not (GetColor(575, 280) = 2369440)) then
Mouse(580, 255, 40, 30, True);
if (oFightMode = 2) and (not (GetColor(658, 280) = 2369440)) then
Mouse(660, 255, 40, 30, True);
if (oFightMode = 3) and (not (GetColor(575, 325) = 2369440)) then
Mouse(580, 305, 40, 30, True);
if (oFightMode = 4) and (not (GetColor(658, 325) = 2369440)) then
Mouse(660, 305, 40, 30, True);
end;

begin
SetupSRL;
wait(1000);
ActivateClient;
for i :=0 to 4 do
SetFightMode2(i);
end.