SRL Archive - OSR Help

Help would be appreciated


gdsht

2012-05-14 06:42:51

Alright, still working on my first script. I currently have a very simple base of the script completed however, when ran the script merely swaps between inventory and magic tab, printing DTM not found.

The offending part of the script


procedure ClickEnchant;
var
spellpos, x, y: Integer;
begin
if FindNormalRandoms then Exit;
if not (GetCurrentTab = tab_Magic) then
GameTab(tab_Magic);
if (finddtm(Spellpos, x, y, MIX1,MIY1,MIX2,MIY2)) then
begin
MMouse(x, y, 3, 3);
if WaitUpTextMulti(['ncha', 'rossb'], 1000 + Random(500)) then
ClickMouse2(mouse_Left)
end else
Writeln('Couldnt find DTM');
end;



the main loop

begin
Smart_server := SERVER;
Smart_Signed := TRUE;
Smart_Members := MEMBERS;
Smart_SuperDetail := FALSE;
SetupSRL;
Mousespeed:= RandomRange(12,15);;
DeclarePlayers;
LoginPlayer;
LoadBoltSetup;
LoadDTMZ;
repeat
ClickEnchant;
EnchantBolts;
Enchant10;
until (not LoggedIn)
FreeDTMz;
end.





Script in its entirety


program AIOBoltEnchant;

{$DEFINE SMART}
{$i srl/srl.simba}
{$IFDEF SMART}
{$i srl/srl/misc/paintsmart.simba}
{$ENDIF}

const
SERVER = 15;
MEMBERS = True;
NumbOfPlayers = 1;
StartPlayer = 0;

type
BoltInfo = record
BoltDTM : integer;
exp : extended;
end;

var
Bolt: BoltInfo;


var
casts, expgain, spellpos, chant10, castsph, x, y: integer;
found: boolean;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name :='';
Pass :='';
Active:=True;
Strings[0] := 'Ruby'; // Bolt - 'opal', 'sapphire', 'jade', 'pearl', 'emerald'
// 'topaz', 'ruby', 'diamond', 'dragonstone', 'onyx'
end;
end;

procedure Antiban; // ALL CREDITS TO LEETZ FOR THE ANTIBAN // currently not in use
begin
if(not(LoggedIn))then
exit;
FindNormalRandoms;
Findnoninventoryrandoms;
Case Random (2500) of
0..18: Begin SleepAndMoveMouse(5000 + Random(750)); End;
19..24: Begin GameTab(tab_Inv) ExamineInv; GameTab(tab_Magic); SleepAndMoveMouse(2500 + Random(553)); End;
25..42: Begin RandomAngle(1); End;
43..48: Begin GameTab(Tab_Stats); Wait(3000 + Random(400)); GameTab(tab_Magic); SleepAndMoveMouse(2550 + Random(658)); End;
49..54: Begin GameTab(tab_Stats) HoverSkill('random', False); GameTab(tab_Magic); SleepAndMoveMouse(2200 + Random(545)); End;
55..60: Begin PickUpMouse; End;
61..66: Begin RandomMovement; End;
67..72: Begin BoredHuman; End;
73..78: begin if(gametab(tab_inv))then Begin ExamineInv; End; end;
End;

end;

procedure Proggress;
begin
//to be added
end;

procedure LoadBoltSetup;
begin
case lowercase(Players[CurrentPlayer].Strings[0]) of
'opal':
begin
Bolt.BoltDTM := DTMFromString('mwQAAAHic42RgYHACYlsg9gRiXyD2AmJrIDYEYnOomAYjA4M4FEsBsSUQG0CxKhBrArGLvgjD/PmdDNOnNTHMmNHMsHfvVjj2NhFjsNcRZiAGMBKB4QAAkJsREg==');

Bolt.Exp := 9;
end;
'sapphire':
begin
Bolt.BoltDTM := DTMFromString('mwQAAAHic42RgYFgAxLOBeDkQrwfiFUA8C4gnAPE0IF4FxGqMDAziUCwHxJZAbAjEBkCsAsQ6QBwUFM8gY3meQdrsKBjv3bsVjgMCYhnc3YMYiAGMRGA4AACEcRPY');
Bolt.Exp := 17.5;
end;
'jade':
begin
Bolt.BoltDTM := DTMFromString('mwQAAAHic42RgYGBmZGDgAuJ/QLYQlP0fyP4ExD+AmBfI1wBicSiWA2JLIDYEYgMgVgNiHSDOzT/KkDDRniF1hhNDfL8dw969WxmKis+C6dLyywzpmbsYiAGMRGA4AAAmiBQz');
Bolt.Exp := 19;
end;
'pearl':
begin
Bolt.BoltDTM := DTMFromString('mwQAAAHic42RgYEhjZGDIBeIkIC4F4jwgTgDiMCCOAeJ8IFYBYjEolgViCyA2AGJ9IFYCYh0gDgkIYOjomcfQ2TcfTO/duxWOg/z8GAJ8fBiIAYxEYDgAAN4oE4E=');
Bolt.Exp := 29.5;
end;
'emerald':
begin
Bolt.BoltDTM := DTMFromString('mwQAAAHic42RgYDjEyMCwD4hPAvFFID4FxHuAeCMQbwPi00CsBsTiUCwHxJZAbADF6kCsB8RBQfEMBselGfSPQvDevVvhODQsmcHDM4SBGMBIBIYDAFWBFQo=');
Bolt.Exp := 33.5;
end;
'topaz':
begin
Bolt.BoltDTM := DTMFromString('mwQAAAHic42RgYPABYg8gDgHiGCAOg7LdgdgGiJ2AeBUjA8NMKF4AxOuBeDcQbwbiTUC8HIh72toY+oQtGdqEzCC4sYFh796tcNzX0c5ADGAkAsMBAE3KFoA=');
Bolt.Exp := 37;
end;
'ruby':
begin
Bolt.BoltDTM := DTMFromString('mwQAAAHic42RgYFgCxPOAeBUQbwLiNUC8GojnAvEkIJ4BxCsYGRhmQvECIF4PxLuBeDMQb2KEyNt72jNkivIxJIvwgrFrgCvD3r1b4RjEJwYwEoHhAAAYpBZl');
Bolt.Exp := 59;
end;
'diamond':
begin
Bolt.BoltDTM := DTMFromString('mwQAAAHicjcevDkBQAEbxT/KneKJb2WiCd9OuTbgEMyaZZ9IEAmdmsrP9wgklXTjhe1KMAAe/YUfEd6heFgsmjGjQIy1SDa2Tq+1jXedPVuYyidGfvB++boFFGfo=');
Bolt.Exp := 67;
end;
'dragonstone':
begin
Bolt.BoltDTM := DTMFromString('mwQAAAHic42RgYIhnZGCIAuI0IM4D4nQgjgRiPyAOAeJcIF4JxDOheAEQ7wbizUC8CYhXQLFPTDJDuf1EhkKbLjDeu3crHPvGpTLYBEYzEAMYicBwAACqQhax');
Bolt.Exp := 78;
end;
'onyx':
begin
Bolt.BoltDTM := DTMFromString('mwQAAAHic42RgYDjEyMCwD4hPAvFFID4FxHuAeCMQbwfiM0C8AohnQvECIN4NxJuBeBNUbi0Q+yekM8hKS8Px3r1b4dg3LpXBMyKegRjASASGAwDqHxeU');
Bolt.Exp := 97;
end;
end;
end;

procedure LoadDTMZ;
begin
SpellPos := DTMFromString('mggAAAHicY2NgYNjKxMCwE4h3AfEGIF4FxWcZGRiOAfFNIL4BxMeB+CIQf18lxyDNy4iBcQFGHBgCAGtTC7M=')
Chant10 := DTMFromString('m6wAAAHic42ZgYOgBYjckfA6ILwNxJxB3AXEeEF8E4nlA/IqRgeEpEL9jhLA/AvELJDEQfg2lZ04oYZgzrZphztRqOA0TA9EwDBInBTCSgJEAACX9Ikc=');
end;


procedure ClickEnchant;
var
spellpos, x, y: Integer;
begin
if FindNormalRandoms then Exit;
if not (GetCurrentTab = tab_Magic) then
GameTab(tab_Magic);
if (finddtm(Spellpos, x, y, MIX1,MIY1,MIX2,MIY2)) then
begin
MMouse(x, y, 3, 3);
if WaitUpTextMulti(['ncha', 'rossb'], 1000 + Random(500)) then
ClickMouse2(mouse_Left)
end else
Writeln('Couldnt find DTM');
end;

procedure EnchantBolts;
begin
if(finddtm(Bolt.BoltDTM, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
MMouse(x, y, 5, 5);
ClickMouse2(Mouse_Right);
end;
end;

procedure Enchant10;
begin
if(finddtm(Chant10, x, y, MIX1, MIY1, MIX2, MIY2))then
begin
MMouse(x, y, 5, 5);
ClickMouse2(Mouse_Left);
Wait(RandomRange(500,1000));
GameTab(Tab_Inv);
wait(RandomRange(25000,26000));
GameTab(Tab_Magic);
end;
end;


procedure FreeDTMz;
begin
FreeDTM(Spellpos);
FreeDTM(Bolt.BoltDTM);
FreeDTM(Chant10);
end;


begin
Smart_server := SERVER;
Smart_Signed := TRUE;
Smart_Members := MEMBERS;
Smart_SuperDetail := FALSE;
SetupSRL;
Mousespeed:= RandomRange(12,15);;
DeclarePlayers;
LoginPlayer;
LoadBoltSetup;
LoadDTMZ;
repeat
ClickEnchant;
EnchantBolts;
Enchant10;
until (not LoggedIn)
FreeDTMz;
end.


Also, yes I am aware that a lot of the code probably looks like steaming horse dung and I also need to add failsafes anti ban, but I would like to get the bastard to work at all before I can get it to work reliably. :p

Any help/tips much appreciated

YoHoJo

2012-05-14 06:43:57

Please change from code tags to simba tags, much easier to read. Thanks.
Might help later, but sleeping now goodnight!

Abu

2012-05-14 11:38:10

You used Records :) *nerdgasm*

Anyway, copy your DTM
Open the DTM Editor
Print your DTM
See if it's still finding the right object.

gdsht

2012-05-14 11:43:29

Following your tutorial too :p

And have done that, still painting the same thing.