SRL Archive - First Scripts

My first script ever


phoenix55

2007-12-09 15:01:22

I had been searching for a script that autoed for magic (weaken in particular) all i could find is high alc ones. So I said screw it im making my own.

Keep in mind this is my first script ever, it DOES compile, but it DOESNT work.

program WeakenerScript;

var
x,y: Integer;
n,m: Integer;

const
WeakenColor = 15533737; //punch in curses color, should be light purple area
MonsterColor = 7963266; //this is where you designate a monster

procedure MagicTab;
begin
MoveMouseSmooth(743,185);
ClickMouse(742,184, true);
end;

procedure CastSpell;
begin
if (FindColor(n,m,WeakenColor,665,665,264,264)) then //making sure you have enough runes
begin
MoveMouseSmooth(668,262);
Wait(50+random(150));
ClickMouse(668,262,true);
end;
begin
if(FindColor(x,y,MonsterColor,0,0,514,335)) then
begin
MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
Wait(100+random(10));
ClickMouse(x,y,true);
end;
end;
end;

begin
MagicTab;
repeat
CastSpell;
until(not(FindColor(n,m,WeakenColor,665,665,264,264)));
if ((not(FindColor(n,m,WeakenColor,665,665,264,264)))=true) then
Writeln('You are out of runes. Get more');
end.

hamster

2007-12-09 15:09:16

Use SRL commands like MMouse and Mouse

also the command CastSpell(spell); in SRL is handy :-)

phoenix55

2007-12-09 15:13:54

whats the syntax of the CastSpell(…) command. and what do you mean by MMouse and mouse.

please excuse my noobyness

hamster

2007-12-09 15:29:37

Firstly, you have to include SRL
{.include SRL/SRL.scar}
you put that ^ at top of your program
if you're goint to use CastSpell(number of the spell)
then you'll also need to include
{.include SRL/SRL/skill/magic.scar}

and about the # of the spell… Just go to your Scar folder=>Includes=>SRL=>SRL=>skill and then magic.scar
open it and look for the big list of all the spells and look what number it is
for example High Alchemy is 35 so you would put CastSpell(35);
Also, it automaticly selects the right gametab, so no need to do failsafe for that on :-)

and Mouse and MMouse are commands in SRL that use a more humanlike mouse than just MoveMouse or stuff like that
MMouse is move mouse and Mouse is clicking it
usually you use it like this
MMouse(x,y,2,2);
(handy for finding color, moving mouse over there and then check if its the right thing you're going to click on)
and
Mouse(x,y,2,2);
It just clicks in that spot (x and y are variables already filled in.
for example
if( FindColor(x,y,Color,x1,y1,x2,y2)) then
Mouse(x,y,2,2);
Here it would look for a certain colour, and then move the mouse to it and click (2,2 is so it wouldnt allways click in the same spot))

hamster

2007-12-09 15:44:34

{//////////////////////////////////////////////////////////////////
//////////Name :Weakener //////////////////
//////////By :Phoenix55 Edited By Hamster//////////////////
//////////Description:Cast Weaken on a monster //////////////////
//////////////////////////////////////////////////////////////////}
program WeakenerScript;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/magic.scar}

var
x,y,i: Integer;

const
MonsterColor = 7963266; //this is where you designate a monster
MonsterName =''; //name of the monster
HowManyCasts = 10;


procedure useSpell;
begin
CastOn(8,MonsterName,MonsterColor,5);
Wait(1000+random(1000));
i := i+1;
end;

begin
SetupSRL;
activateClient;
i := 0;
repeat
useSpell;
until(i >= HowManyCasts)
end.

Don't know if it works, could contain some bugs, didnt test it :-)
But this might get you an idea :p

Edit: sorry about the double post, my bad

phoenix55

2007-12-09 16:21:39

wow thanks ill go test it

_______________________________________________________

Line 21: [Error] (15424:37): Type mismatch in script


———————————————————–

How do i fix that error.. anyone? some help?

phoenix55

2007-12-09 19:48:15

I have no idea how to fix that -.-

Tazzie 02

2007-12-10 00:21:01

Please neither of you double post. It is a cheap way of getting extra posts. Just a question, what is line 21? I may be able to help if I know what the line is. (Sorry, I'm not home so I don't have SCAR). Also, maybe only enter one part of the monsters name. eg. Goblin = obli or something like that. Nice idea to make your own script aswell. If you keep up with scripting, you could add a login player procedure aswell using SRL.

xxrobbiechaosxx

2007-12-12 18:01:13

Doesn't work…

freedox

2007-12-17 14:07:51

You should fix the script and make it better and you should learn some more about srl and scripting and then you can make better and harder scripts…like fighting script or some kind of skill maker….GL :)
PS!Not bad for 1 time script;)

Naike

2007-12-19 14:44:28

You should Read Jad's Thread of fixing anoying errors! Its really handy ^^