SRL Archive - First Scripts

EEE addon


catlover444

2012-05-07 02:19:18

Trying to get this sucker to work correctly. I could have used x, y coordinates for everything but I wanted to be able to quickly add a case/ DTM and have it variable for anything I could do.

Right now it'll compile but won't complete the loop. Once I get it to do a full loop I'll try and incorporate the fail-safes.


program click;
{$DEFINE SRL5}
{$DEFINE CRASHSMART}
{$DEFINE SMART}
{$i SRL/srl.simba}
{$i SPS/sps.simba}
{$i srl/srl/skill/fighting.simba}
{$i SRL/SRL/misc/paintsmart.simba}
{$I SRL/SRL/Misc/Debug.Simba}

const

EEE = 1; //0= NO EEE, 1= EEE
WTU = 1; //1=CMAUL, 2=SSWORD






procedure UseEEE;
var WEP, EXCAL, FSPEC, ESPEC, x, y :integer;

begin
EXCAL:= DTMFromString('m1gAAAHic42JgYOACYiYgZgZiXiAWA2IZIBaGyrExQAA/EIsCsQCSHhDghOoBYWkgXjBzJlQWPzZiIA4wEokRAAC3tAMs'); //EEE
FSPEC := DTMFromString('mKgEAAHic42NgYGgH4nQgLoey+6C4GYiLgTgUiA2BmJEBAkShYhxALI6EhYCYkwE7EIVikJqEZlcGLk52MGZiYmTg4+ViYGVlYeAUZEfBbNysDAysPAyMnAIMIoK8DJI4zCYEGMnEqAAAl6YIVA=='); //FULL SPECIAL
ESPEC := DTMFromString('mFQEAAHic42VgYDBmQIAGIM4D4lAgNgNiFiBmA2IlKD8AiLuBmB2IuaG0IBQLILEZoZgBSoPUWVlZMkhLSzNYWloyMDIyYmAuLm4whrH5BIUYyAGMZGAUAACcDQXE'); // EMPTY SPECIAL

Case WTU of
1:
WEP := DTMFromString('mAAEAAHiclcvBCkBAFIXhg8aCIYVG0bydkvd/AH85C0vz17e650ZJEwbM2LBjxYjOgt4aRCz+6dGi9j14n3Ag47xuL/7JKqsq9O0B53cCxg=='); //CMAUL
2:
WEP := DTMFromString('mfgEAAHicrc1LCoAwEATR9kOEIEQiSgKey0t5AY9rg7UQXOrAYzY1SZY06J7OemvZwZKttqHYbJONFulFV2kWusyOvC/6wH2iLY8/zmOn+qbqn2l+8p4L6VIDzA=='); //SSWORD
end;


begin //Wield EEE
FindDTM(EXCAL, x, y, MIX1, MIY1, MIX2, MIY2);
MMouse(x, y, 5, 5);
//if IsUpText('nhanced') then
//begin
ClickMouse2(MOUSE_LEFT);
FindDTM(WEP, x, y, MIX1, MIY1, MIX2, MIY2)
WaitFindDTM(x, y, WEP, 800);

//end else
// exit;

FreeDTM(EXCAL);
FreeDTM(WEP);
end;
// Switches to Combat tab
Gametab(tab_Combat);


begin //Use Special
FindDTM(FSPEC, x, y, MIX1, MIY1, MIX2, MIY2);

MMouse(x - 60, y, 10, 5);
//if IsUptextMultiCustom(['oggl', 'pec', 'ttack']) then
// begin
ClickMouse2(MOUSE_LEFT);
FindDTM(ESPEC, x, y, MIX1, MIY1, MIX2, MIY2)
WaitFindDTM(x, y, ESPEC, 800); // Verify Special Used
writeln('FOR EXCALIBUR');
;
// end else
// exit;
FreeDTM(ESPEC)
FreeDTM(FSPEC);
end;



Gametab( tab_Inv); // Inventory Tab

begin
begin //Wield Weapon
FindDTM(WEP, x, y, MIX1, MIY1, MIX2, MIY2);
MMouse(x, y, 5, 5);
ClickMouse2(MOUSE_LEFT);
FindDTM(EXCAL, x, y, MIX1, MIY1, MIX2, MIY2);
WaitFindDTM( x, y, EXCAL, 800);

end
FreeDTM(WEP);
FreeDTM(EXCAL);

end;

end;


Procedure TimeEEE;
begin
Case EEE of
0:
exit;
1:
end;
// while(===action) do
begin
UseEEE;
wait(300000);
end;

end;


begin
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

SetupSRL;
TimeEEE;
end.

Error:

Error: Exception: The given DTM Index[5] doesn't exist at line 79
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]
Successfully saved: C:\Users\Will\Desktop\DTM\useEEE.simba

I've tried to google DTM index error and I was told to change the positioning of my FreeDTM to right before the end. But that doesn't resolve it.

Thank you for any help.

[D]ude

2012-05-07 02:54:39

Could you provide more details on what you are trying to accomplish?

Janilabo

2012-05-07 03:19:39

Does your code really even compile? I am surprised if it really does…

Your code, with correct syntax, should look something like this (so note: This probably wont do what you are looking for, it will require couple changes here and there, but this will point you to right direction here):

program click;

{$DEFINE SRL5}
{$DEFINE CRASHSMART}
{$DEFINE SMART}
{$I SRL/srl.simba}
{$I SPS/sps.simba}
{$I SRL/SRL/skill/fighting.simba}
{$I SRL/SRL/misc/paintsmart.simba}
{$I SRL/SRL/Misc/Debug.Simba}

const
EEE = True; //False = NO EEE, True = EEE
WTU = 1; //1 = CMAUL, 2 = SSWORD

var
WEP, EXCAL, FSPEC, ESPEC: Integer;

procedure LoadDTMs;
begin
EXCAL := DTMFromString('m1gAAAHic42JgYOACYiYgZgZiXiAWA2IZIBaGyrExQAA/EIsCsQCSHhDghOoBYWkgXjBzJlQWPzZiIA4wEokRAAC3tAMs'); //EEE
FSPEC := DTMFromString('mKgEAAHic42NgYGgH4nQgLoey+6C4GYiLgTgUiA2BmJEBAkShYhxALI6EhYCYkwE7EIVikJqEZlcGLk52MGZiYmTg4+ViYGVlYeAUZEfBbNysDAysPAyMnAIMIoK8DJI4zCYEGMnEqAAAl6YIVA=='); //FULL SPECIAL
ESPEC := DTMFromString('mFQEAAHic42VgYDBmQIAGIM4D4lAgNgNiFiBmA2IlKD8AiLuBmB2IuaG0IBQLILEZoZgBSoPUWVlZMkhLSzNYWloyMDIyYmAuLm4whrH5BIUYyAGMZGAUAACcDQXE'); // EMPTY SPECIAL
case WTU of
1: WEP := DTMFromString('mAAEAAHiclcvBCkBAFIXhg8aCIYVG0bydkvd/AH85C0vz17e650ZJEwbM2LBjxYjOgt4aRCz+6dGi9j14n3Ag47xuL/7JKqsq9O0B53cCxg=='); //CMAUL
2: WEP := DTMFromString('mfgEAAHicrc1LCoAwEATR9kOEIEQiSgKey0t5AY9rg7UQXOrAYzY1SZY06J7OemvZwZKttqHYbJONFulFV2kWusyOvC/6wH2iLY8/zmOn+qbqn2l+8p4L6VIDzA=='); //SSWORD
end;
end;

procedure UnloadDTMs;
begin
FreeDTM(EXCAL);
FreeDTM(FSPEC);
FreeDTM(ESPEC);
FreeDTM(WEP);
end;

procedure UseEEE;
var
x, y: Integer;
begin //Wield EEE
FindDTM(EXCAL, x, y, MIX1, MIY1, MIX2, MIY2);
MMouse(x, y, 5, 5);
if IsUpText('nhanced') then
begin
ClickMouse2(MOUSE_LEFT);
FindDTM(WEP, x, y, MIX1, MIY1, MIX2, MIY2)
WaitFindDTM(x, y, WEP, 800);
end else
Exit; // Switches to Combat tab
Gametab(tab_Combat);
FindDTM(FSPEC, x, y, MIX1, MIY1, MIX2, MIY2);
MMouse(x - 60, y, 10, 5);
if IsUptextMultiCustom(['oggl', 'pec', 'ttack']) then
begin
ClickMouse2(MOUSE_LEFT);
FindDTM(ESPEC, x, y, MIX1, MIY1, MIX2, MIY2)
WaitFindDTM(x, y, ESPEC, 800); // Verify Special Used
WriteLn('FOR EXCALIBUR');
end else
Exit;
Gametab( tab_Inv); // Inventory Tab
FindDTM(WEP, x, y, MIX1, MIY1, MIX2, MIY2);
MMouse(x, y, 5, 5);
ClickMouse2(MOUSE_LEFT);
FindDTM(EXCAL, x, y, MIX1, MIY1, MIX2, MIY2);
WaitFindDTM( x, y, EXCAL, 800);
end;

procedure TimeEEE;
begin
if not EEE then
Exit;
UseEEE;
Wait(300000);
end;

begin
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
LoadDTMs;
TimeEEE;
UnloadDTMs;
end.

Flight

2012-05-07 03:23:00

Might I ask what "EEE" stands for?

[D]ude

2012-05-07 03:46:48

Yeah. We'll need more info if you want the help you need

catlover444

2012-05-07 10:23:25

http://tinypic.com/player.php?v=2vikokg&s=6

EEE stands for elite enahanced excalibur, EE= enhanced excalibur. Basically it's special heals 200/400 lp over 20 seconds every 5 minutes (spec recharge). Goal was to create a script that could be inserted into other combat scripts for supplemental healing.

All that extra SMART stuff was to try and get it to run as a standalone which I can remove later. Ultimately I want to not use a timer, but continually search for the green text below:


Try this in Runescape with your chaotic maul (or sarasword) equipped and the Excalibur anywhere in your inventory.




program click;

{$DEFINE SRL5}
{$DEFINE CRASHSMART}
{$DEFINE SMART}
{$I SRL/srl.simba}
{$I SPS/sps.simba}
{$I SRL/SRL/skill/fighting.simba}
{$I SRL/SRL/misc/paintsmart.simba}
{$I SRL/SRL/Misc/Debug.Simba}

const
EEE = True; //False = NO EEE, True = EEE
WTU = 1; //1 = CMAUL, 2 = SSWORD

var
WEP, EXCAL, FSPEC, ESPEC: Integer;

procedure LoadDTMs;
begin
EXCAL := DTMFromString('m1gAAAHic42JgYOACYiYgZgZiXiAWA2IZIBaGyrExQAA/EIsCsQCSHhDghOoBYWkgXjBzJlQWPzZiIA4wEokRAAC3tAMs'); //EEE
FSPEC := DTMFromString('mKgEAAHic42NgYGgH4nQgLoey+6C4GYiLgTgUiA2BmJEBAkShYhxALI6EhYCYkwE7EIVikJqEZlcGLk52MGZiYmTg4+ViYGVlYeAUZEfBbNysDAysPAyMnAIMIoK8DJI4zCYEGMnEqAAAl6YIVA=='); //FULL SPECIAL
ESPEC := DTMFromString('mFQEAAHic42VgYDBmQIAGIM4D4lAgNgNiFiBmA2IlKD8AiLuBmB2IuaG0IBQLILEZoZgBSoPUWVlZMkhLSzNYWloyMDIyYmAuLm4whrH5BIUYyAGMZGAUAACcDQXE'); // EMPTY SPECIAL
case WTU of
1: WEP := DTMFromString('mAAEAAHiclcvBCkBAFIXhg8aCIYVG0bydkvd/AH85C0vz17e650ZJEwbM2LBjxYjOgt4aRCz+6dGi9j14n3Ag47xuL/7JKqsq9O0B53cCxg=='); //CMAUL
2: WEP := DTMFromString('mfgEAAHicrc1LCoAwEATR9kOEIEQiSgKey0t5AY9rg7UQXOrAYzY1SZY06J7OemvZwZKttqHYbJONFulFV2kWusyOvC/6wH2iLY8/zmOn+qbqn2l+8p4L6VIDzA=='); //SSWORD
end;
end;

procedure UnloadEEEDTMs;
begin
FreeDTM(EXCAL);
FreeDTM(FSPEC);
FreeDTM(ESPEC);
FreeDTM(WEP);
end;

procedure UseEEE;
var
x, y: Integer;
begin //Wield EEE
FindDTM(EXCAL, x, y, MIX1, MIY1, MIX2, MIY2);
Mouse(x, y, 5, 5, True);
wait(200)
Gametab(tab_Combat); // Switches to Combat tab
FindDTM(FSPEC, x, y, MIX1, MIY1, MIX2, MIY2);
Mouse(x - 60, y, 10, 5, True);
WriteLn('FOR CAMELOT');
Gametab( tab_Inv); // Inventory Tab
FindDTM(WEP, x, y, MIX1, MIY1, MIX2, MIY2);
Mouse(x, y, 5, 5, True);
ClickMouse2(MOUSE_LEFT);
UnloadEEEDTMs;
end;

procedure TimeEEE;
begin
if not EEE then
Exit;
UseEEE;
end;

begin
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
LoadDTMs;
TimeEEE;
end.

[D]ude

2012-05-07 12:30:34

Instead of have it find the DTM for the special bar, I would just use x, y coordinates. You could have it scan for a certain color at a location on the special bar to see if the special is high enough for you to be able to use it. You could implement this scan before every kill and then if it is true then use the spec which would simply click the correct x, y coordinates and you will use the spec on a monster with full health

catlover444

2012-05-07 13:04:08

The special doesn't damage, it only heals. So that wouldn't be an issue. I just need to set it so it does the loop once, then repeats when the green text in the image shows up.

[D]ude

2012-05-07 13:30:24

Okay then use

if FindChatBoxText(Text: string; Line: Integer; TextCol: Integer) then
begin
end else;

Olly

2012-05-07 14:13:49

You could just have a timer running after you click the special… if timefrommark > 2.5mins then click special again if you get me.

catlover444

2012-05-07 16:25:01

Yes, but what happens when it doesn't fill exactly in time. Plus can be suspicious if you do this every 5 minutes exactly.

Thank you dude.

Striken

2012-05-07 19:20:02

Make it wait about 6 minutes with a 1 - 30 second random.