SRL Archive - RS3 Outdated / Broken Scripts

Wizards Delight


killhack95

2010-05-12 05:52:59

I finally finished my first (not actually first, but the one that does something usefull) script!
Presenting to your pleasure,
Wizards Delight.

Currently it is an high alchemy autoalcher,but i am planning to add more features.The inspiration to this was the auto alch script by pyroryan, witch i noticed didn't use the magic include but instead used coordinates, witch i don't think is very reliable, and i thought with a bit of time i could write a better one!

This script is also posted on the first script section, but i will be adding superheating witch uses banking, so i don't want any non junior members leeching it off.
Bugs:
1. A lot of times it gets stuck on the skill screen saying that cant allocate dib or something. This happens when it checks the users magic level.
this is what the debug box sais :
[Runtime Error] : Exception: Can't allocate the DIB handle in line 439 in script C:\Documents and Settings\Administrator\Desktop\scar\includes\SRL\SRL\Core\GameTab.scar

Without further ado, the Wizards Delight version 1.
Added mini proggie.

Baked0420

2010-05-12 07:46:07

From: killhack95
i will be adding superheating witch uses banking, so i don't want any non junior members leeching it off.


Free-For-All and Junior Members Scripts subforums joined together didn't they? I thought new members could view Jr Member scripts now.

and I don't want to high alch on an account, I don't have a reason to and I think it's too commonly botted, once you add superheating though, I'll test it for you and get up a proggy if I don't forget about this thread by the time you release superheating.

killhack95

2010-05-12 08:43:48

ok, once i get the time to i will start writing it hard :D

Sir R. M8gic1an

2010-05-12 09:48:39

All members can see JM threads ;)

~RM

Baked0420

2010-05-12 09:52:25

they used to be able to see the threads but not the scripts.. Can they get the scripts now? I thought I remembered seeing a thread saying the are/will be able to see the scripts, not positive.

killhack95

2010-05-12 11:33:12

May i please have some suggestions?

Blumblebee

2010-05-12 11:55:22

aside from the obvious need for standards (you seem to sort of have a grasp of it but not really) there is a few mistakes. I'm too lazy to search them all out for you but I found an obvious one I'll point out.

  procedure checkforitems;
var
x,y,runedtm,itemdtm : integer;
begin
runedtm := DTMFromString('78DA637464626078C6800204AB45C0342394C' +
'FE80754738F010D30A1AAF106F2DF1150630AE4BF22A0C601C8FF' +
'845F0D00CE02069A');
itemdtm := DTMFromString('78DA633CC0C4C0F0980105385A89806946289' +
'FF12C50CD030634C084AAE63490FF91809A5D40FE7B026A3601F9' +
'CFF0AB0100CD8208F9');
gametab(tab_Inv);
wait(1000+random(2000));
if(FindDtm(runedtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
begin
freedtm(runedtm);
if(FindDtm(itemdtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
freedtm(itemdtm);
begin
writeln('Items found, proceeding to alch');
end;
end else
begin
writeln('Items not found, quitting.');
terminatescript;
end;
end;

the script will always write "Items Found" as your begin..end nesting is in the wrong place! The procedure should look like this:

procedure checkforitems;
var
x,y,runedtm,itemdtm : integer;
begin
runedtm := DTMFromString('78DA637464626078C6800204AB45C0342394C' +
'FE80754738F010D30A1AAF106F2DF1150630AE4BF22A0C601C8FF' +
'845F0D00CE02069A');
itemdtm := DTMFromString('78DA633CC0C4C0F0980105385A89806946289' +
'FF12C50CD030634C084AAE63490FF91809A5D40FE7B026A3601F9' +
'CFF0AB0100CD8208F9');
gametab(tab_Inv);
wait(1000+random(2000));
if(FindDtm(runedtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
begin
freedtm(runedtm);
if(FindDtm(itemdtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
begin
freedtm(itemdtm); // This needs to be in the begin..end nesting
writeln('Items found, proceeding to alch');
end;
end else
begin
writeln('Items not found, quitting.');
// terminatescript;
NextPlayer(False); // Switches Players Instead
end;
end;

I merged the freeDTM() with the writeln. You also should do some editing of that procedure as it doesn't really matter if you have the item at all tbh, it just looks for the rune DTM, if it doesn't find the item DTM then you just don't get a writeln. I would do something like…

procedure checkforitems;
var
x,y,runedtm,itemdtm : integer;
begin
runedtm := DTMFromString('78DA637464626078C6800204AB45C0342394C' +
'FE80754738F010D30A1AAF106F2DF1150630AE4BF22A0C601C8FF' +
'845F0D00CE02069A');
itemdtm := DTMFromString('78DA633CC0C4C0F0980105385A89806946289' +
'FF12C50CD030634C084AAE63490FF91809A5D40FE7B026A3601F9' +
'CFF0AB0100CD8208F9');
gametab(tab_Inv);
wait(1000+random(2000));
if(FindDtm(runedtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
if(FindDtm(itemdtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
begin
freeDTM(runedtm);
freedtm(itemdtm); // This needs to be in the begin..end nesting
writeln('Items and Runes found, proceeding to alch');
end else
begin
writeln('Items not found, quitting.');
// terminatescript;
NextPlayer(False); // Switches Players Instead
end;
end;

although I would also make it a function and return a boolean result too, but a procedure works just fine aswell.

it's a well done first script, congrats :)

killhack95

2010-05-12 12:03:04

aside from the obvious need for standards (you seem to sort of have a grasp of it but not really) there is a few mistakes. I'm too lazy to search them all out for you but I found an obvious one I'll point out.


I have a grasp of standards because i program in c++, but when learning other programming languages i try to write the best i can for me to be easier to understand what i write.

the script will always write "Items Found" as your begin..end nesting is in the wrong place! The procedure should look like this:


Oops, didn't notice that. The debug file i used didn't have this error (i had two scar windows opened at the same time, i used the first one to modify the script and check if it works, then paste to the other.

it's a well done first script, congrats


Well it's not my FIRST first script, i have written an autobaner thingy but up until now i didn't have the motivation to start scripting seriously because i wanted to study c++ hard. And i seem to changed my mind on what i want to study, so i thought that moving to this nice community here and start cheating on runescape with my own work to be a nice hobby :D
Thanks again!

EDIT:
And can someone post why the heck doesn't it work correctly with S.M.A.R.T?

Dgby714

2010-05-12 12:03:46

Went in and clean the standards and moved some stuff around because it looked like it wouldnt work how you had it also changed a few functions to make them look better.

program WizardsDelight;
{$DEFINE SMART} //Uncomment to Disable SMART
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Magic.scar}
{.include SRL/SRL/misc/QuickChat.scar}

const
Signed_SMART = True; //If you want to use signed SMART
Members_World = False; //If you want to auto on a members world
SMART_World = 109; //The world SMART will load up

procedure DeclarePlayers;
begin
NumberOfPlayers(1); //Dont Change there is no MultiPlayer....
CurrentPlayer := 0;

with Players[0] do
begin
Name := ''
Pass := '';
Nick := '';
BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal'];
Active := True;
Integers[0] := 10 //times to alch
end;
end;

function SetupPlayer: boolean;
var
MagicLVL: integer;
begin
MagicLVL := getskilllevel(skill_Mage);
if (MagicLVL >= 55)then
Result := True;
end;

function checkforitems: boolean;
var
x, y, DTMRune, DTMItem: integer;
begin
DTMRune := DTMFromString('78DA637464626078C6800204AB45C0342394C' +
'FE80754738F010D30A1AAF106F2DF1150630AE4BF22A0C601C8FF' +
'845F0D00CE02069A');
DTMItem := DTMFromString('78DA633CC0C4C0F0980105385A89806946289' +
'FF12C50CD030634C084AAE63490FF91809A5D40FE7B026A3601F9' +
'CFF0AB0100CD8208F9');
try
GameTab(tab_Inv);
Wait(1000 + Random(2000));
if (not (FindDtm(DTMRune, x, y, MIX1, MIY1, MIX2, MIY2))) then
Exit
else
if (not (FindDtm(DTMItem,x,y,MIX1,MIY1,MIX2,MIY2))) then
Exit
else
Result := True;
finally
FreeDTM(DTMRune);
FreeDTM(DTMItem);
end;
end;

procedure AntiBan;
begin
case Random(40) of
0..3 : Wait(1);
4..13 : MMouse(Random(500), Random(500), 0, 0);
14 : begin
HoverSkill('magic', False);
GameTab(Tab_Inv);
end;
15 : begin
GameTab(22);
Wait(1000 + Random(3000));
GameTab(Tab_Inv);
end;
16 : begin
if (Random(2) = 1) then
begin
Keydown(VK_RIGHT);
Wait(300+random(1500));
KeyUp(VK_RIGHT);
end else
begin
Keydown(VK_LEFT);
Wait(300 + Random(1500));
KeyUp(VK_LEFT);
end;
Wait(1400 + Random(1400));
MakeCompass('N');
SetRun(True);
end;
end;
end;

procedure alch;
var
DTMItem, x, y, timesalched, xpgained, FailCount: integer;
begin
DTMItem := DTMFromString('78DA633CC0C4C0F0980105385A89806946289' +
'FF12C50CD030634C084AAE63490FF91809A5D40FE7B026A3601F9' +
'CFF0AB0100CD8208F9');
FailCount := 0;
timesalched := 0;
xpgained := 0;
try
while (timesalched <= Players[CurrentPlayer].Integers[0]) do
begin
gametab(tab_Magic);
cast('High Level Alchemy', false);
if(FindDtm(DTMItem, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
FailCount := 0;
Mouse(x, y, 5, 5, True);
FindNormalRandoms;
Wait(600 * 5 + Random(100));
FindNormalRandoms;
Inc(timesalched);
IncEx(xpgained, 65);
ClearDebug;
Writeln('Xp gained: ' + IntToStr(xpgained));
Writeln('Times alched: ' + IntToStr(timesalched));
end else
begin
Inc(FailCount);
FindNormalRandoms;
Wait(1000 + Random(300));
antiban;
if (FailCount >= 15) then
Exit;
end;
end;
finally
FreeDTM(DTMItem);
end;
end;


begin
SetupSRL;
DeclarePlayers;
Wait(500);
ActivateClient;
LoginPlayer;
SetRun(True);
SetAngle(True);
if SetupPlayer then
if checkforitems then
alch
else
WriteLn('Required Items Missing!')
else
WriteLn('Player Magic Level too Low!');
writeln('Succesfully finished alcheming. Good day!');
end.

killhack95

2010-05-12 12:12:39

dude you're so hasty, i was just about finished cleaning mine…
Uploaded the 1.1 version

Dgby714

2010-05-12 12:38:03

Ok i guess ill just give some pointers =0

procedure DeclarePlayers;
var
I: Integer;
begin
NumberOfPlayers(100); //Dont touch
CurrentPlayer := 0;

with Players[0] do
begin
Name := ''
Pass := '';
Nick := '';
BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal'];
Active := True;
integers[0] := 1000 //times to alch
end;

for I := High(Players) downto 0 do
begin
if Players[i].Active then
begin
NumberOfPlayers(i + 1);
Break;
end;
end;
end;

can be

procedure DeclarePlayers;
begin
NumberOfPlayers(1); //Dont touch
CurrentPlayer := 0;

with Players[0] do
begin
Name := ''
Pass := '';
Nick := '';
BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal'];
Active := True;
integers[0] := 1000 //times to alch
end;
end;
as your script only will only take 1 character (no multiplayer)



procedure setup;
var
magiclvl : integer;
begin
magiclvl := getskilllevel(6);
writeln(magiclvl);
if (magiclvl < 21)then
begin
writeln('Noobs don`t deserve to alch...');
Logout;
terminatescript;
end;
if ( magiclvl > 20 )then
begin
writeln('Training,eh?');
option := 1;
if (magiclvl > 54)then
begin
writeln('Ok, set course to high alchemy!');
option := 2;
end;
end;
end;
Wont work as your missing a end;

Edit: Found the end; O.o ok mabye it would work but it would WriteLn that your training and using HighAlch O.o

alt:
procedure setup;
begin
case GetSkillLevel(skill_Mage) of
1..20: begin
Players[CurrentPlayer].Loc := 'Low Magic Level';
WriteLn('Noobs don`t deserve to alch...');
Logout;
TerminateScript;
end;
21..53: begin
Players[CurrentPlayer].Loc := 'Low Alch''ing';
WriteLn('Training, Eh?');
option := 1;
end;
54..99: begin
Players[CurrentPlayer].Loc := 'High Alch''ing';
WriteLn('Ok, set course to high alchemy!');
option := 2;
end;
else
begin
Players[CurrentPlayer].Loc := 'Unknow Magic Level';
WriteLn('Error getting Magic Level');
Logout;
TerminateScript;
end;
end;
end;



procedure checkforitems;
var
x,y,runedtm,itemdtm : integer;
begin
runedtm := DTMFromString('78DA637464626078C6800204AB45C0342394C' +
'FE80754738F010D30A1AAF106F2DF1150630AE4BF22A0C601C8FF' +
'845F0D00CE02069A');
itemdtm := DTMFromString('78DA633CC0C4C0F0980105385A89806946289' +
'FF12C50CD030634C084AAE63490FF91809A5D40FE7B026A3601F9' +
'CFF0AB0100CD8208F9');
gametab(tab_Inv);
wait(1000+random(2000));
if(FindDtm(runedtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
begin
if(FindDtm(itemdtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
begin
freeDTM(runedtm);
freedtm(itemdtm); // This needs to be in the begin..end nesting
writeln('Items and Runes found, proceeding to alch');
end else
begin
writeln('Items not found, quitting.');
// terminatescript;
NextPlayer(False); // Switches Players Instead
end;
end;
end;
will only free dtms if it finds them O.o
another note You dont use multiplayer properly so no NextPlayer;
fix:
procedure checkforitems;
var
x, y, runedtm, itemdtm: integer;
begin
runedtm := DTMFromString('78DA637464626078C6800204AB45C0342394C' +
'FE80754738F010D30A1AAF106F2DF1150630AE4BF22A0C601C8FF' +
'845F0D00CE02069A');
itemdtm := DTMFromString('78DA633CC0C4C0F0980105385A89806946289' +
'FF12C50CD030634C084AAE63490FF91809A5D40FE7B026A3601F9' +
'CFF0AB0100CD8208F9');
gametab(tab_Inv);
wait(1000+random(2000));
try
if(FindDtm(runedtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
if(FindDtm(itemdtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
writeln('Items and Runes found, proceeding to alch')
else
begin
writeln('Items not found, quitting.');
terminatescript;
end
else
begin
writeln('Items not found, quitting.');
terminatescript;
end;
finally
FreeDTM(runedtm);
FreeDTM(itemdtm);
end;
end;



begin
SetupSRL;
{$IfDef SMART}
Smart_Server := Smart_World;
Smart_Signed := Signed_SMART;
Smart_Members := Members_World;
{$EndIf}
DeclarePlayers;
LoginPlayer;
wait(2000+random(500));
setup;
checkforitems;
alch;
writeln('Succesfully finished alcheming. Good day!');
end.
Smart_Server, Smart_Signed and Smart_Members need to be set before SetupSRL;
begin
{$IFDEF SMART}
Smart_Server := Smart_World;
Smart_Signed := Signed_SMART;
Smart_Members := Members_World;
{$ENDIF}
SetupSRL;
DeclarePlayers;
Wait(100 + Randon(100));
LoginPlayer;
Wait(2000 + Random(500));
setup;
checkforitems;
alch;
WriteLn('Succesfully finished alcheming. Good day!');
end.


Last in Antiban;
0..3 : Wait(1);
Why Wait(1)? You wouldnt even notice it…. mabye Wait(100 + Random(1000));

killhack95

2010-05-12 13:10:10

Can you tell me how to add multiplayer?
And also,

procedure checkforitems;
var
x, y, runedtm, itemdtm: integer;
begin
runedtm := DTMFromString('78DA637464626078C6800204AB45C0342394C' +
'FE80754738F010D30A1AAF106F2DF1150630AE4BF22A0C601C8FF' +
'845F0D00CE02069A');
itemdtm := DTMFromString('78DA633CC0C4C0F0980105385A89806946289' +
'FF12C50CD030634C084AAE63490FF91809A5D40FE7B026A3601F9' +
'CFF0AB0100CD8208F9');
gametab(tab_Inv);
wait(1000+random(2000));
try
if(FindDtm(runedtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
if(FindDtm(itemdtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
writeln('Items and Runes found, proceeding to alch')
else
begin
writeln('Items not found, quitting.');
terminatescript;
end
else
begin
writeln('Items not found, quitting.');
terminatescript;
end;
finally
FreeDTM(runedtm);
FreeDTM(itemdtm);
end;
end;

Somethings wrong, there are two 'item not found, quitting.' 's
Are they really both needed?

Frement

2010-05-12 13:11:59

From: killhack95
Can you tell me how to add multiplayer?


Well, you need to use these functions/procedures:
NextPlayer
AllPlayersInactive
LogOut
LoginPlayer

procedure DeclarePlayers;
begin
NumberOfPlayers(2); //Dont touch
CurrentPlayer := 0;

with Players[0] do
begin
Name := ''
Pass := '';
Nick := '';
BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal'];
Active := True;
integers[0] := 1000 //times to alch
end;

with Players[1] do
begin
Name := ''
Pass := '';
Nick := '';
BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal'];
Active := True;
integers[0] := 1000 //times to alch
end;
end;

Dgby714

2010-05-12 13:19:53

From: killhack95
Can you tell me how to add multiplayer?
And also,

procedure checkforitems;
var
x, y, runedtm, itemdtm: integer;
begin
runedtm := DTMFromString('78DA637464626078C6800204AB45C0342394C' +
'FE80754738F010D30A1AAF106F2DF1150630AE4BF22A0C601C8FF' +
'845F0D00CE02069A');
itemdtm := DTMFromString('78DA633CC0C4C0F0980105385A89806946289' +
'FF12C50CD030634C084AAE63490FF91809A5D40FE7B026A3601F9' +
'CFF0AB0100CD8208F9');
gametab(tab_Inv);
wait(1000+random(2000));
try
if(FindDtm(runedtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
if(FindDtm(itemdtm,x,y,MIX1,MIY1,MIX2,MIY2)) then
writeln('Items and Runes found, proceeding to alch')
else
begin
writeln('Items not found, quitting.');
terminatescript;
end
else
begin
writeln('Items not found, quitting.');
terminatescript;
end;
finally
FreeDTM(runedtm);
FreeDTM(itemdtm);
end;
end;

Somethings wrong, there are two 'item not found, quitting.' 's
Are they really both needed?


Yes one is if runes are missing and one is if items are missing.

killhack95

2010-05-12 13:22:22

ok, now one more thing, why does it not see the magic level when running on smart?

Dgby714

2010-05-12 13:24:26

From: killhack95
ok, now one more thing, why does it not see the magic level when running on smart?


Havnt got the faintest idea >.>

Mabye make a BypassMagicCheck constant?

killhack95

2010-05-12 13:32:53

Maybe. I haven't seen anyone using skillcheck for a while now…