SRL Archive - First Scripts

SuperBatManS SuperAlcher


superbatman

2009-01-13 23:48:01

Heres my first program. It is an alcher. Has quite a bit of features for a first program (i think). AntiRandoms, antiban, randomtalk(talks magic only),AutoBuy(will buy more alch sets if you wish(read in the consts, you can set the item, and the price of both the alch item and nats.)
I got about 900alchs/hour minimum and 1050 alchs max. it counts how many youve alched, how much xp youve gotten, how many alchs bought, and has magic xp goals. Will prob add a timer soon, antilost (incase antirandoms fail), maybe smart(if i can find out wtf SMART is), and mybe autoflechter

Critisizm is HIGHLY welcomed. I see that as a way to make me better.

(sorry for bad writing and grammar, i broke my right index finger and it shard to type.)

Aser

2009-01-14 00:09:47

It looks really nice for a first script. I don't have an account to test this on or I would. I can try to offer you some help from just looking it over though…

Your buyyews procedure should be BuyYews (just for cosmetics), same with buynats.

Your BuyYews procedure does not have failsafes for the first bit of that. I would recommend that you add some. You have some later on in the procedure.

Line 50: [Error] (16256:1): Semicolon (';') expected in script

Can be fixed by adding a semicolon on the line above after your string.

Line 182: [Error] (16388:29): Type mismatch in script

AlchItem is a string and as thus does not need IntToStr

After those changes it compiles nicely.

Critisizm is HIGHLY welcomed. I see that as a way to make me better.

Awesome attitude. You will make it far here.


until(x=999999999999)

No, bad. Make sure you add some fail safes onto that. Basically that is an endless loop. Try setting a constant asking them how many times they want to alch if they don't want to buy. Maybe cut down on some of the constants. Capitalize your variables.


MagicLvl=72; //Input magy lvl;

Should be able to be replaced with GetLevel('Magic'…); (don't know the exact way, should be an easy search)

Do all of the GE colors/coords change so much that you have to input them every time? If not try to cut down on those. The chatbox coords shouldn't change much either and so you shouldn't need them as constants.

Again, it looks pretty good. Just some small changes.

Sandstorm

2009-01-14 00:18:15

To much of it is preset coordinate clicking. Add some failsafes. Make it use colors to find it.

But for a first script, it looks really good! Better then a lot of scripts I've seen as firsts. Read up on some tuts. If you still need some help, feel free to post in the help section or private message me.

~Sandstorm

anonymity

2009-01-14 00:32:00

Nice info Aser.
I agree with Sandstorm, change it up a little… add a few DTM's/DDTM's or something…

ian.

2009-01-14 01:39:07

:D nice for a first,

use ChooseOption instead of clicking a coord,

use GameTab instead of looking for the colors,

and some other things that were already said..

but again, a lot better than my first script :p

keep it up ^^

superbatman

2009-01-14 09:47:15

lolz, thanks all. yah know what, i kinda noticed a few semicolons missing, but for sum reason, it still comiled for me. I think one of the main things i needa do is look into srl more, cause there is obviously more avalable isin SLR. I dunno if anyone noticed, but i didnt use until false at the end of my main loop, because for some reason, it would only do 4 alchs then stop.

jakeyboy29

2009-01-14 11:36:41

cord clicking fails.

Sandstorm

2009-01-14 11:40:13

/Captain Obvious.

~Sandstorm

jakeyboy29

2009-01-14 11:54:19

From: Sandstorm
To much of it is preset coordinate clicking. Add some failsafes. Make it use colors to find it.


~Sandstorm


/captain obvious

Sandstorm

2009-01-14 12:19:07

From: jakeyboy29
/captain obvious


I stated that because no-one else had? There were like four people who did before you.

Not gonna argue with you though.

~Sandstorm

superbatman

2009-01-14 18:00:53

Chord clicking? It is working fine for me… Is that the tabs? Im going to look into SRL for some tabs, and other stuff….

I just Tryed To add some SRL, i changed out all the BTMTabs with GameTab(7); which i thought was supposed to go to the magic tab, but for me it does nothing.
The BTMTab that i wrote myself works for me, but u guys r saying it isnt working.

Oh, I have a question. I never drag the cross hair to the rs game tab because "canvis doesnt alow drawing of box" on FindColorTolerance functions.
I attacted the new code that uses GameTab, if anyone would try it out, id b thankful.

Sandstorm

2009-01-14 18:09:24

If you included srl (you use Mouse, so I guess you did :P) you can go through the gametabs like this:

GameTab(Tab Number);

Where the tabs are set up like this:

1 2 3 4 5 6 7 8
9 10 11 12 13

Something like that.

~Sandstorm

ian.

2009-01-14 18:11:15

coords not chords :P

coords as in co-ordinates.. it works fine, it just is VERY bannable..

superbatman

2009-01-14 18:16:44

SandStorm, read my edit please. 99, a bit more specific please, i will try to make it as ban free as posibble.

Sandstorm

2009-01-14 18:33:52

I'm not sure. Are you using the regular client? If so, try it in Firefox or Swiftkit.

~Sandstorm

superbatman

2009-01-14 18:36:48

im using firefox.
Im Redownloading Scar, cause my script stopped working altogether

ian.

2009-01-14 18:52:50

your FindMoveNotes won't work for everyone, you have a certain color for it, and a const color too, but it won't change it in the proc..

and the gametab error is because you call it in the wrong place..

Instead of (FindColorTolerance(blahblah)) just do GameTab(7);

should work :)

superbatman

2009-01-14 19:36:46

I did that look up a few posts of mine. I found Out why it wasnt working for me, it was because i wasnt setting the RS game tab to client. I never set the rs tab to client because when i do, findcolortolerance() wont work, i get returned :
[Runtime Error] : Exception: Canvas does not allow drawing in line 238 in script C:\Documents and Settings\Admin\Desktop\Alcher.scar

superbatman

2009-01-14 23:02:43

Lolz, well i couldnt find anything on the Runtime error, but i did find something quite interesting. I found that in global.scar it has all the endpoint for the mainscreen, chat screen, inv screen and minimap. Im suprised nobody told me that because that was like half of my Consts. oh well….. lolz

Oo, and i got gametab() up now so thats a bit better. I changed many of the coords to findcolortolerances, so that should be better too.. Im gonna go change out my custom consts for the global.scar coords, ill post my new code in a bit.


OMG OMG OMG, i just found heaven…….
In Scar, go to the help tab and then the SRL manual tab. It is a full on library…. omg… heaven…. omg…. lolz, that is what took away all my consts(well…. some of them.) Now there should Be no problem with you guys running this im not even using coords to cast the spelll or choose inv item. It takes alot of the work out of it(which was kinda fun, and takes a little self pride out of it) but ow well….

ian.

2009-01-15 00:26:13

if you want work, make it flawless :D

fail safes, extreme anti ban, be able to tele to somewhere and alch there to mix it up.. :)

make it able to start anywhere :D

you can do a lot more advance stuff to it

senrath

2009-01-15 00:30:47

If you add this:
{.include srl/srl/skill/Magic.scar}
you can use this:
Cast('high level alchemy');
to cast your spells.

superbatman

2009-01-15 01:31:52

yeah, i probably will in the future. Im expecting a temp ban to come any day now, lolz. I still have to find out my runtime errror though. =(

senarth, already done =0. Thanks though =)

ian.

2009-01-15 01:37:58

you still need help with that runtime? >.>

do you have gmail?

nvm.. I added you..

add me? :D

Phran6

2009-01-15 16:46:53

if you want to add smart to your script

Find this line:



{.Include SRL\SRL.SCAR}

Change it to:


{.Include SRL\SRL\Misc\SMART.SCAR}
{.Include SRL\SRL.SCAR}

Hit CTRL+F.

Type in SetUpSRL;

Find this line:


SetUpSRL;

Change it to:

SMARTSetUp(SmartPrefix, True, True, False);
SetTargetDC(SMARTGetDC);
SetUpSRL;


and if it dont work


change:

Smartsetup(SmartPrefix, true, true, false);
Settargetdc(smartgetdc);


for :

SMARTSetupEx(2, True, True, False);
Wait(5000);
SetTargetDC(SmartGetDC);
repeat
wait(100);
until(SmartGetColor(253, 233)<>1118604);

superbatman

2009-01-15 17:01:31

I have No idea what smart does, can you explain a bit? Anyway, im having other problems with my script. When i try to ad SRL/SRL/SKill/Magic.scar as an include it returns 'identifier expected'. Heres my new version, it should work, there may be some silly errors in it, but seeing as i cant compile it i cnat find errors or test it.

Ive Re-Downloaded SRL/SCAR 5 times and it still wont work.

senrath

2009-01-15 17:09:00

From: superbatman
I have No idea what smart does, can you explain a bit? Anyway, im having other problems with my script. When i try to ad SRL/SRL/SKill/Magic.scar as an include it returns 'identifier expected'. Heres my new version, it should work, there may be some silly errors in it, but seeing as i cant compile it i cnat find errors or test it.

Ive Re-Downloaded SRL/SCAR 5 times and it still wont work.


SMART stands for SCAR Minimizable Autoing Resource Thing. I think. Anyway, it's a RS client designed for SCAR and SRL that can be minimized and still have the script running.

And to fix your error, add an end; to your SendReport procedure. It's missing one.

Also, change line 85. It doesn't work.

superbatman

2009-01-15 18:07:39

kk, i changed those, its running now. SMART isnt Compiling. It Has A whole bunch of duplicate identifiers.

And WTF on ur interesting fact, .9999999999……… isnt equal to 1

senrath

2009-01-15 18:27:46

I haven't used SMART in a while, so I can't help you with that. But I can tell you that my fact is indeed accurate. Check here.

superbatman

2009-01-15 18:59:20

Lolz, wikipedia? I think logic comes before theory, and logically, .99999999.. is not equal to 1. Im trying to rune a smart file, it compiles, but its violating access, ill have to try to find out the admin pass…. any idears?

senrath

2009-01-15 19:16:04

From: superbatman
Lolz, wikipedia? I think logic comes before theory, and logically, .99999999.. is not equal to 1.


But logic doesn't come before fact. And the fact of the matter is that .9… is exactly equal to 1.

superbatman

2009-01-15 20:09:56

No Fact Does Not Come Before logic. Fact Was Created by human logic, so obviously logic came before fact.

ian.

2009-01-15 21:11:06

if .999… is equal to 1, would 1.999… be equal to 2?

anyways..

program SuperAlcher;
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/Magic.scar}

{************************************************************|
{**********************Welcome To: **************************|
{**********************SUPERBATMANS**************************|
{**********************SUPERALCHER***************************|
{************************************************************|
{Features:
{-AntiRandoms(SRL)
{-AntiBan(Mostly Homemade)
{-Lots of consts(colors seem to vary a bit)
{-Option to buy more alchs when out of them
{************************************************************
{Directions:
{1.Have your Yew longs(or whatever your gonna alch) in 13th
{Inv spot.
{2.Run program.
{3.Enjoy
{************************************************************
{Other:
{-I get about 900-1050 alchs per hour with this.
{-I just Let it run for my first time during school, I had 10k
(alchs in My Inv, when i got back i had about 2900 left(2892)
{-Ive Tested buying and it always worked for me, but there is
{Something i dont like about it. I dunno what it is, but oh well
{-It was wierd, it didnt look like i got any randoms while i
{was gone, and i was only using 1 player, i didnt get any randoms
{during testing.
{**************************************************************
Please report bugs/problems to:
[email]Wannab723@gmail.com[/email] or PM Me on SRL
-I plan on adding extra features like antilost, and maybe if its
a good idea, autofletcher, but that stuff will all come in time.
-I might ad SMART but i really dont fully understand what it is.
If you could kindly explain it to me, im all ears.
{***************************************************************}


var
x,y,count,fullcount,alchs,bored,talk,outofstuff,
alchsbought,magiclvl,magicxp,magiclvl,magicxp,xpneed,
alchneed,averagexp: integer;


const

//SET THESE//
AlchItem='yew longbow'; //if your not buying yew longbows, change that here(also change price lower);
buymorestuff=true; //set to true if you want script to buy more alchs for you
muted=false; //Set to true if muted(will use quickchat);
AmountToBuy=500; //amount of alchs to buy when out of alchs(if buymorestuff=true)
PriceOfNats=240; //price to buy nature runes for ea.
PriceOfYews=690; //price to buy yew longbows for ea.
goals=true; //set to true if you want goals
goallvl=99;
xpgoal=13034431;
//ONLY SET IF COLORS OR COORDS ARENT WORKING//
yewnote=7971763; //set to color of notes of yews(they where changing on me so i added this
alchcolor=643794; //yellow alch color in magic tab
CTContinue=16711680; //Color of ClickToContinue in chatbox
ChatSword=10264383; //When Given options in chatbox, there is 2 swords, The Color Of the Middle Gem in handle of Left Sword
ExClerk=4335153; //Blue Suit Color On GE clerks
BuyArrow=247475; //ColorOf the Yellow Down Arrow For buy in GE
ItemText=23200; //When Input options in buy, orange text color of the name of the item
DotAmount=39167; //The Color Of the '...'(orangish) to put in custom amount to buy of item in GE
ConfirmOffer=39116; //Orange Text of Confirm in GE offers
AmountBoxTX=477; //In GE, the X coordinates of the Top-left square for Custom amount in buy tab
AmountBoxTY=358; //Same as above Top Y coordinate
AmountBoxBX=511; //' ' Bottom X coordinate
AmountBoxBY=381; //' ' Bottom Y coordinate
PriceBoxTX=685; //These Are All the same as above, but for the custom price tab Top X
PriceBoxTY=357; //Top Y
PriceBoxBX=723; //Bottom X
PriceBoxBY=379; //Bottom Y
(*&^*^DONT SET*&^*)
askmagelvl=1;
tellmagelvl=2;

procedure SetGoals;
begin
xpneed:=xpgoal-magicxp;
alchneed:=xpneed/65;
averagexp:=alchs/StrToInt(TimeRunning);
end;



procedure buynats;
begin

FindColorTolerance(x,y,ExClerk,MSX1, MSY1, MSX2, MSY2,5);
Mouse(x,y,0,0,true);
wait(800+random(1400));
FindColorTolerance(x,y,CTContinue,MCX1, MCY1, MCX2, MCY2, 5);
Mouse(x,y,0,0,true);
wait(800+random(1400));
Mouse(x,y,0,0,true);
wait(800+random(1400));
FindColorTolerance(x,y,ChatSword,MCX1, MCY1, MCX2, MCY2, 5);
wait(800+random(1200));
Mouse(x,y+20,50,2,true);
wait(800+random(500));
FindColorTolerance(x,y,CTContinue,MCX1, MCY1, MCX2, MCY2, 5);
wait(1200+random(800));
Mouse(x,y,0,0,true);
wait(1200+random(1400));
Mouse(x,y,0,0,true);
wait(1500+random(1400));
FindColorTolerance(x,y,BuyArrow,MSX1, MSY1, MSX2, MSY2,5);
Mouse(x,y,2,2,true);
wait(1200+random(200));
TypeSend('nature rune');
wait(500+random(500));
FindColorTolerance(x,y,ItemText,MCX1, MCY1, MCX2, MCY2, 5);
Mouse(x,y,1,1,true);
wait(500+random(500));
FindColorTolerance(x,y,DotAmount,AmountBoxTX,AmountBoxTY,AmountBoxBX,AmountBoxBY,5);
Mouse(x,y,1,1,true);
wait(500+random(500));
TypeSend(IntToStr(AmountToBuy));
wait(500+random(500));
FindColorTolerance(x,y,DotAmount,PriceBoxTX,PriceBoxTY,PriceBoxBX,PriceBoxBY,5);
Mouse(x,y,1,1,true);
wait(500+random(500));
TypeSend(IntToStr(PriceOfNats));
wait(500+random(500));
FindColorTolerance(x,y,ConfirmOffer,446,445,589,496,5);
Mouse(x,y,3,3,true);
wait(2500+random(1200));
If(FindColorTolerance(x,y,1999423,MSX1, MSY1, MSX2, MSY2,5)=false) then
Begin
repeat
wait(2000+random(15000))
until(FindColorTolerance(x,y,1999423,MSX1, MSY1, MSX2, MSY2,5)=true)
end;
If(FindColorTolerance(x,y,1999423,MSX1, MSY1, MSX2, MSY2,5)=true) then
begin
Mouse(x,y,3,3,true);
wait(800+random(500));
If(FindColorTolerance(x,y,1947358,MSX1, MSY1, MSX2, MSY2,5)=true) then
begin
Mouse(x,y,3,3,true);
end;
if(FindColorTolerance(x,y,1543442,MSX1, MSY1, MSX2, MSY2,5)=true) then
begin
Mouse(x,y,3,3,true);
end;
end;
wait(2500+random(1500));
end;

procedure buyyews;
begin


FindColorTolerance(x,y,BuyArrow,MSX1, MSY1, MSX2, MSY2,5);
Mouse(x,y,2,2,true);
wait(1200+random(200));
TypeSend(AlchItem);
wait(500+random(500));
FindColorTolerance(x,y,ItemText,MCX1, MCY1, MCX2, MCY2 ,5);
Mouse(x,y,1,1,true);
wait(500+random(500));
FindColorTolerance(x,y,DotAmount,AmountBoxTX,AmountBoxTY,AmountBoxBX,AmountBoxBY,5);
Mouse(x,y,1,1,true);
wait(500+random(500));
TypeSend(IntToStr(AmountToBuy));
wait(500+random(500));
FindColorTolerance(x,y,DotAmount,PriceBoxTX,PriceBoxTY,PriceBoxBX,PriceBoxBY,5);
Mouse(x,y,1,1,true);
wait(500+random(500));
TypeSend(IntToStr(PriceOfYews));
wait(500+random(500));
FindColorTolerance(x,y,ConfirmOffer,446,445,589,496,5);
Mouse(x,y,3,3,true);
wait(2500+random(1200));
If(FindColorTolerance(x,y,1999423,MSX1, MSY1, MSX2, MSY2,5)=false) then
Begin
repeat
wait(2000+random(15000));
MMouse(1,1,1000,800);
until(FindColorTolerance(x,y,1999423,MSX1, MSY1, MSX2, MSY2,5)=true)
end;
If(FindColorTolerance(x,y,1999423,MSX1, MSY1, MSX2, MSY2,5)=true) then
begin
Mouse(x,y,3,3,true);
wait(800+random(500));
If(FindColorTolerance(x,y,1947358,MSX1, MSY1, MSX2, MSY2,5)=true) then
begin
Mouse(x,y,3,3,true);
end;
if(FindColorTolerance(x,y,1615291,MSX1, MSY1, MSX2, MSY2,5)=true) then
begin
Mouse(x,y,3,3,true);
end;
end;
wait(500+random(800));
Mouse(MMCX, MMCY,5,5,true);
wait(2500+random(1500));
end;






function CheckForAlchs: boolean;
begin
If(FindColorTolerance(x,y,alchcolor, MIX1, MIY1, MIX2, MIY2,5)=false) and(FindColorTolerance(x,y,yewnote, MIX1, MIY1, MIX2, MIY2,5)=false) then
begin
result:=false;
end;

if(FindColorTolerance(x,y,alchcolor, MIX1, MIY1, MIX2, MIY2,5)=true) or (FindColorTolerance(x,y,yewnote, MIX1, MIY1, MIX2, MIY2,5)=true) then
begin
result:=true;
end;
end;

procedure SendReport;
begin
AddToReport('/^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\');
AddToReport('| HELLO AND WELCOME TO |');
AddToReport('| SUPERBATMANS |');
AddToReport('| SUPERALCHER+ |');
AddToReport('|__________________________________________|');
AddToReport('|This Script has been running for: |');
AddToReport('|'+TimeRunning+' |');
AddToReport('|__________________________________________|');
AddToReport('|In the '+TimeRunning+' This Program has been |');
AddToReport('|running you have received: |');
AddToReport('|'+IntToStr(magicxp)+ ' MagicXp |');
AddToReport('|__________________________________________|');
AddToReport('|Your Current Magic Level Is: |');
AddToReport('|'+IntToStr(magiclvl)+' |');
AddToReport('|__________________________________________|');;
AddToReport('|Your Goal Magic Level Is: |');
AddToReport('|'+IntToStr(Goallvl)+' |');
AddToReport('|__________________________________________|');
AddToReport('|To get to your goal Magic Level of: |');
AddToReport('|'+IntToStr(Goallvl)+' |');
AddToReport('|You Must Get: |');
AddToReport('|'+IntToStr(xpneed)+' XP |');
AddToReport('|Which Is About: |');
AddToReport('|'+IntToStr(alchneed)+' Alchs |');
AddToReport('|__________________________________________|');
AddToReport('|You Have Alched: |');
AddToReport('|'+IntToStr(fullcount)+' Times |');
AddToReport('|In'+TimeRunning+' |');
AddToReport('|For about: |');
AddToReport('|'+IntToStr(Averagexp)+' XP per second. |');
AddToReport('|__________________________________________|');
end;

//main//
begin
SetupSRL;
GameTab(7);
repeat
magiclvl:=GetSkillInfo('magic',false);
magicxp:=GetXp('magic');
SetGoals;
ClearReport;
SendReport;
if(CheckForAlchs=true) then
begin
Cast('High Level Alchemy');
MouseItem(13,true);
count:=count+1;
fullcount:=count+1;
alchs:=fullcount*65;
bored:=random(50);
talk:=random(100);
FindNormalRandoms;
//Random Check Magic Xp(Antiban);
if(count=30+random(25)) then
begin
GameTab(2);
wait(500+random(800));
HoverSkill('magic',false);
wait(1500+random(800));
GameTab(7);
end;
//Going Back To Magic Tab If Lost;
if(FindColorTolerance(x,y,alchcolor, MIX1, MIY1, MIX2, MIY2,5)=false) then
begin
GameTab(7);
end;
//Random Bored(Antiban);
if(bored=3) then
begin
boredhuman;
end;
//Random tell Magic lvl/Ask Magic Lvl(antiban);
if(talk=13) then
begin
if(FindColorTolerance(x,y,14474460,MCX1, MCY1, MCX2,MCY2,5)=true) then
begin
if(muted=true) then
begin
Mouse(x,y,1,1,true);
TypeSend('S');
wait(200+random(200));
TypeSend('M');
wait(200+random(200));
TypeSend(IntToStr(askmagelvl));
wait(200+random(200));
Mouse(x,y,1,1,true);
TypeSend('S');
wait(200+random(200));
TypeSend('M');
wait(200+random(200));
TypeSend(IntToStr(tellmagelvl));
wait(200+random(200));
end;
if(muted=false) then
begin
TypeSend('My Magic Level is ' + IntToStr(MagicLvl));
TypeSend('What is your level in Magic?');
end;
end;
end;
if(CheckForAlchs=false) then
wait(10000+random(5000));
begin
if(CheckForAlchs=false) then
begin
if(outofstuff=1) then
begin
writeln('Out of Nature Runes');
AddToReport('Out of Nature Runes');
writeln('Out of Yew LongBows');
AddToReport('Out of Yew LongBows');
if(buymorestuff=true) then
begin
buynats;
buyyews;
DragItem(5,13);
alchsbought:=alchsbought+AmountToBuy;
end;
outofstuff:=2;
end;
end;
end;
end;
until(x=999999999999)
end.

you also need to add some fail safes.. like.. if it doesn't find the DTM or something, it will end the script.

superbatman

2009-01-15 22:29:10

Failsafes where? The only repeat loop i have is the main, im really pretty knew to this stuff, so i dunno where else to put fail safes. Do you mean in my If() loops? I thought that if the condition wasnt true then it just wont do anything, that is how it is in C anyway.

Also, is it ok if i modifiy FindNormalRandoms so that it doesnt open the inventory every time i call the function? i have it modified, i just dont want anybody to get mad at me, ya know?

ian.

2009-01-15 22:57:26

:P well if it doesn't find the, can't check atm, doing spanish, mage tab, it would just sit there for 5 mins >.>

well, at least for me.. I didn't have rs open and it didn't find anything so it just sat there :o

superbatman

2009-01-15 23:02:32

Oh, i get what your saying. So Make it to where if it doesnt find the mage tab, have it end the script? It should find the mage tab now, I have an updated version, ill get it up in a min, im using all SRL for the game tabs, casting, and item inv finding. One sec, brb


EDIT: New Version attachted.(im working on antilost from randoms that are failed, its not done yet thought im reading up on DTMs ATM)

As you can see, The Main is alot smaller, but it is actually doing more, and its more effitiant than v1.0. ALso, its almost 2.5Kb smaller than the previous version:p

EDIT: Added capabilities for low level alch and camelot teleport, there a then expected in the script in line 307, but i cant find it( if you find it please tell me.)

Tell Me what you think about updated version plz.