SRL Archive - First Scripts

My firts auto smither


Acel92

2007-09-30 14:52:11

Yay here it is!!!my first scar script!! Ok it dosent do more than smith bronze daggers in varrock but its only version 0,1.:redface:
im going to add antiban features and antirandoms soon but now i have 2 read more tuts.. Btw is there an Tut of how to double log in in rs yet??? otherwise i make 1…
And before i posted this script i saw this post:

first things first...include srl...clickmouse = BAN...use Mouse which will move the mouse and click it...read tuts 
(HyperSecrets post i think)
going to fix that soon so dont blame me if u get banned….


program Vsmither;
//version: 0,1
//start between the anvils in varrock and with a hammer and 5 bronze bars
//the script will smith 5 daggers if it works correctly!!!
// i know its a noobie script but its my first 1 and i didnt want to make an autotalker cuz i think they
//are 2 easy to make...-.-
var
x,y,BronzeBar,Dagger : integer;
procedure LoadBronzeBar;
begin
BronzeBar := BitmapFromString(34, 27, 'beNrt1T0OQEAQhmF7AJ1' +
'KJyoRB3AAicQNFO5/DMRPhl2z82Mqvrz9k51mk+Sf8dw1E2JoC5gB' +
'dCcMOIwYu2pJfcY4cXa8i8sxCGhxzignpr6mE02ZyQiashMwFkFQA' +
'gSMQsSUCBFUQoTTEL4iIGAUhUmsSpGnWzinIC4KzimIdb7yxIkJXP' +
'E5GQE/KQonJXicmiBx7xEYZ/bvn9yHNwP+QcQI');
end;

procedure LoadDagger;
begin
Dagger := BitmapFromString(25, 34, 'beNpjYBimgJFKhjB6WypSZh' +
'rIkGQPc6A5lBkFMgRuDgVGoZtjIs9AiVFwcygwCt0cKho10OZgMWq' +
'gQxvdqEHgNXSjSDeHkUpeY1yyWASSZyl30oR+QaBpG9aLQIoRCoKI' +
'sbqKd/pUweVLQabt2SVOSSqKi+Wor+OdNRNk2uZNIvv2ih8/Kg7zM' +
'umxlsTR1sI7b47gqhVQ006dEL90QYqM4Aq15ACirg5BiGnbtoJMe/' +
'KIVKOg5gARJAoWzgeZRpYHGeHmwEty8kIJ2UkUVkmDzByQUTu3i7x' +
'8LkO5k4Axfva0OOXmAHMKMJvAUjWlvoMlnsHTLKEYAADX0nUj');
end;
begin

loadBronzeBar;
movemousesmooth(280,180)
findbitmap(BronzeBar,x,y);
wait(500)
movemousesmooth(x+15,y+15);
clickmouse(x+15,y+15,true);
wait(2000);
movemousesmooth(271,213)//change theese if it dosent find the anvil!!
wait(500)
clickmouse(271,213,true)//same as above
wait(6000)
LoadDagger;
if
findbitmap(dagger,x,y)
then
wait(500)
movemousesmooth(x+15,y+15)
wait(6000)
clickmouse(x+15,y+15,false);
wait(500)
movemousesmooth(23,104) //change these if u want o smith 10 or 1 dagger
wait(1000)
clickmouse(23,104,true) //same as above
end.

JNCR

2007-09-30 15:29:00

Yes, as HyperSecret said, ClickMouse and MoveMouseSmooth will get you banned.

Instead, use the great gift of Scar Recource Library, or SRL.

Currently SRL 4 is available, as well as SCAR 3.12. If you have neither, then first download SCAR 3.12, then follow the tutorial here to get SRL 4.

If you did it right, then you should have SRL.

Now you need to put SRL in your script. To do this, change the top to:
Program Vsmither;
{.include SRL/SRL.scar}
.
What this does is includes SRL into your script. But it does not work yet. You need to set it up in your script.

To setup SRL in your script, put this in your main loop:
SetupSRL;

And that's it! Now you can use all the advantages of SRL.

For dealing with the mouse, use Mouse(x,y,1,1,[true/false]). Mouse moves the mouse to x and y, with randomness 1,1 (you can use any numbers you want, I just use 1,1), and true for left click, false for right click. You can use this to replace MoveMouseSmooth and ClickMouse.

Or if you just need to move the mouse, use MMouse(x,y,1,1). This will just move the mouse to x,y, with 1,1 Randomness.

These are just two of the many advantages of programming with SRL. If you browse through SRL in the include folder, then you can see the greatness of it. Like the many skill functions. Or the antirandoms. Do some searching for yourself.

PM me if you need any more help,
~JNCR

Harry

2007-09-30 15:31:44

Nice post JNCR.

Also, random wait on the waits is good too:

Wait(1000+Random(4000)); <– Waits 1 second and a random 4 seconds.

JNCR

2007-09-30 19:12:23

Also, you should add Failsafes, like this:


Label
Retry;

begin
SetupSRL;
LoadBronzeBar;
Retry:
FindBitmap(BronzeBar,x,y);
MMouse(x,y,1,1);
If(IsUpText('some text that is desplayed when highlighting the anvil')) then mouse(x,y,1,1,true);
if not(IsUpText('some text that is desplayed when highlighting the anvil')) then GoTo Retry;
end.

What this means is that if it finds the text to the top right of the screen that appears when you highlight over the anvil it will click. Otherwise, it will GoTo the Label Retry. This will Retry looking for the anvil. If you still need help understanding GoTo then look here.

Hope this helps,
~JNCR

PS: You should add a loop that repeats the smithing process until a specified number, so that you dont have to make your main loop so large, and so that the user can select the amount he wants smithed. Just a tip.

JNCR

2007-09-30 19:33:43

Also, when you are done with the smithing, you should put this in your script:
FreeBitmap(BronzeBar);
FreeBitmap(Dagger);

This just clears the bitmaps so the computer doesn't lag.

~JNCR

Acel92

2007-10-01 12:55:14

ty guys!! going to update the script today and maybe add a banker…
i allready got srl4 and isnt there a banker include in srl or am i wrong???

HyperSecret

2007-10-01 14:06:06

yes banking functions, for opening and such, but you have to get it to walk to the bank from the location and back and deposit what you want it to deposit

Sk8boardinggit

2007-10-02 09:13:41

From: alberts00
good work


Dude, Are you trying to get your 10 posts or something? I've noticed you've put really short messages in about 4/5 topics like. Well done. Good work. Srl 4.0 pls?… Geez At least try and add to the community. And before i get flamed. I'm adding to the community as i'm halfway through my own SCAR script to share with everyone.
Sk8boardinggit.

cracker667

2007-10-07 00:29:32

:google:

Looks Good To Me Ty Man

DillonSykes

2007-10-07 01:13:57

Yeah you will be banned really fast if you dont change it.