SRL Archive - Test corner

Function HoverSpell(Which: Integer; Cast:Boolean): Boolean;


R0b0t1

2007-06-01 20:26:44

Make sure to tell me which works better! thanks.



Thanks: JAD - the idea.

Example of use: HoverSpell(1, True); (hover over spell home tele and click it)

USE: For antiban, antirandoms ect. Will return true if you can cast the spell (runes, not level).

Notes: Made "Which" and integer so it could be better implemented into anti-randoms.

Any suggestions/comments?


program HoverMagic;
{.Include SRL/SRL.scar}

Function HoverSpell(Which: Integer; Cast:Boolean): Boolean;
Var xm, ym, xz, yz:Integer;
begin;
If (not (GameTab(7)))Then
GameTab(7);
GetMousePos(xz, yz);
Case Which of
1: begin; //Home tele //Row 1
xm:= 575;
ym:= 235;
end;
2: begin;
xm:= 600;
ym:= 235;
end;
3: begin;
xm:= 623;
ym:= 240;
end;
4: begin;
xm:= 650;
ym:= 240;
end;
5: begin;
xm:= 674;
ym:= 235;
end;
6: begin;
xm:= 697;
ym:= 240;
end;
7: begin;
xm:= 720;
ym:= 238
end;
8: begin; //Row 2
xm:= 577;
ym:= 262;
end;
9: begin;
xm:= 600;
ym:= 262;
end;
10: begin;
xm:= 622;
ym:= 261;
end;
11: begin;
xm:= 649;
ym:= 261;
end;
12: begin;
xm:= 670;
ym:= 263;
end;
13: begin;
xm:= 696;
ym:= 265;
end;
14: begin;
xm:= 721;
ym:= 265;
end;
15: begin; //Row 3
xm:= 579;
ym:= 286;
end;
16: begin;
xm:= 600;
ym:= 286;
end;
17: begin;
xm:= 623;
ym:= 286;
end;
18: begin;
xm:= 647;
ym:= 286;
end;
19: begin;
xm:= 671;
ym:= 287;
end;
20: begin;
xm:= 697;
ym:= 285;
end;
21: begin;
xm:= 718;
ym:= 286;
end;
22: begin; //Row 4
xm:= 580;
ym:= 311;
end;
23: begin;
xm:= 600;
ym:= 311;
end;
24: begin;
xm:= 627;
ym:= 313;
end;
25: begin;
xm:= 646;
ym:= 309;
end;
26: begin;
xm:= 627;
ym:= 312;
end;
27: begin;
xm:= 694;
ym:= 310;
end;
28: begin;
xm:= 721;
ym:= 309;
end;
29: begin; //Row 5
xm:= 577;
ym:= 335;
end;
30: begin;
xm:= 601;
ym:= 334;
end;
31: begin;
xm:= 624;
ym:= 338;
end;
32: begin;
xm:= 649;
ym:= 336;
end;
33: begin;
xm:= 673;
ym:= 334;
end;
34: begin;
xm:= 697;
ym:= 335;
end;
35: begin;
xm:= 720;
ym:= 335;
end;
36: begin; //Row 6
xm:= 572;
ym:= 356;
end;
37: begin;
xm:= 599;
ym:= 359;
end;
38: begin;
xm:= 624;
ym:= 356;
end;
39: begin;
xm:= 649;
ym:= 359;
end;
40: begin;
xm:= 671;
ym:= 362;
end;
41: begin;
xm:= 649;
ym:= 362;
end;
42: begin;
xm:= 720;
ym:= 361;
end;
43: begin; //Row 7
xm:= 704;
ym:= 544;
end;
44: begin;
xm:= 731;
ym:= 552;
end;
45: begin;
xm:= 755;
ym:= 550;
end;
46: begin;
xm:= 781;
ym:= 550;
end;
47: begin;
xm:= 800;
ym:= 552;
end;
48: begin;
xm:= 827;
ym:= 552;
end;
49: begin;
xm:= 851;
ym:= 550;
end;
50: begin; //Row 8
xm:= 705;
ym:= 573;
end;
51: begin;
xm:= 731;
ym:= 571;
end;
52: begin;
xm:= 752;
ym:= 572;
end;
53: begin;
xm:= 781;
ym:= 572;
end;
54: begin;
xm:= 801;
ym:= 572;
end;
55: begin;
xm:= 826;
ym:= 572;
end;
56: begin;
xm:= 851;
ym:= 562;
end;
57: begin; //Row 9
xm:= 704;
ym:= 598;
end;
58: begin;
xm:= 729;
ym:= 597;
end;
59: begin;
xm:= 753;
ym:= 598;
end;
60: begin;
xm:= 776;
ym:= 599;
end;
61: begin;
xm:= 802;
ym:= 599;
end;
62: begin;
xm:= 822;
ym:= 599;
end;
63: begin;
xm:= 850;
ym:= 599;
end;
end;
If (FindColorTolerance(x, y, 65280, 680, 440, 870, 456, 5) or
FindColorTolerance(x, y, 65280, 680, 600, 870, 625, 5)) Then
begin;
Result:= True;
end else
begin;
Result:= False;
end;
If (Cast) Then
begin;
MMouse(xm, ym, 5, 5);
Wait(500+Random(1000));
Mouse(xm, ym, 5, 5, True);
end else
begin;
MMouse(xm, ym, 5, 5);
Wait(3000+Random(3000));
MMouse(xz, yz, 5, 5);
end;
end;

begin
WriteLn('spell 36 makes the box to top');
WriteLn('Green spell color is: 65280');
HoverSpell(36, False);
If not (HoverSpell(36, False)) Then
Writeln('TEST COMPLETE');
end.


USE: HoverSpell(0, 0, True); //Click home teleport.

Note: maybe less antiban friendly.

program New;
{.Include SRL/SRL.scar}

Function HoverSpell(Row, Column: Integer; Cast: Boolean): Boolean;
Var i, b, xm, ym, xz, yz: Integer;
begin;
If not (GetCurrentTab = 7)Then
begin;
MouseBox(730, 175, 740, 205, 1);
Wait(500+Random(1000));
end;
xm:= 575;
ym:= 235;
GetMousePos(xz, yz);
For I:=1 to Row do
begin;
ym:= ym + 30;
end;
For B:=1 to Column do
begin;
xm:= xm + 25;
end;
If (FindColorTolerance(x, y, 65280, 680, 440, 870, 456, 5) or
FindColorTolerance(x, y, 65280, 680, 600, 870, 625, 5)) Then
begin;
Result:= True;
end else
begin;
Result:= False;
end;
If (Cast) Then
begin;
MMouse(xm, ym, 3, 3);
Wait(500+Random(1000));
Mouse(xm, ym, 3, 3, True);
end else
begin;
MMouse(xm, ym, 3, 3);
Wait(3000+Random(3000));
MMouse(xm, ym, 3, 3);
end;
end;

begin
BenMouse:= True;
HoverSpell(1, 3, False);
If (HoverSpell(1, 3, False)) Then
WriteLn('YAY!');
end.

shaunthasheep

2007-06-01 20:41:37

hmm, to improve look at the cast spell function (or w/e its name), im pretty sure it goes by:

x := colleft + (colwidth * col);

something like that, i just wrote that off the top of my head

JAD

2007-06-01 20:50:57

……


:p I'm going to have one to hover a magic skill when I get out of school.. Because I've done that quite a few times while playing in game :p


Wow.. I can't even believe you'd take that idea from me….. Oh well I guess.

At least give me credits for Stealing my idea??

R0b0t1

2007-06-02 00:48:55

I'm sorry I took your idea, but if you want to go ahead and make your own - I won't continue this.

I'll go find something else :)

JAD

2007-06-02 10:32:54

From: r0b0t1
I'm sorry I took your idea, but if you want to go ahead and make your own - I won't continue this.

I'll go find something else :) but make love not war.


Lol.. I don't even care about you making this that much. But you took my idea, you didn't give me any credits for the idea, and you called it your own right? Plagarizm is against the rules, so taking somebody's idea falls under that category I think.

Next time just ask permission, and if you get a no, don't do it.

And I'm not trying to start war, but if you break into a bank and steal everything in it, then you are the one starting the war my friend.

R0b0t1

2007-06-02 11:20:18

Ok, I WILL remeber you lesson.

But I borrowed your idea - you can have it back now.

JAD

2007-06-02 11:25:21

From: r0b0t1
Ok, I WILL remeber you lesson.

But I borrowed your idea - you can have it back now.


Like I said.. It's not the idea that I really cared about, its the principal, and it's that now I can't trust you because I wouldn't want you to steal anything else (Or "borrow" as you'd call it) from me.

Whatever though, we're cool, just can't trust you.

shaunthasheep

2007-06-02 13:56:30

jeeze, lol calm down. He tried to help the community. Give him some credit, he supposedly stole your idea, big whoop, but the work he put into this function should still be recognized.

Nice work, robot1.