SRL Archive - Include Development

lets get an other update :)


Awkwardsaw

2009-11-26 15:33:15

i would like to get an other rev update, so please post ideas, so i can make the functions, and add them :) also post functions if you think they should be added to the includes

uncfan1119

2009-11-26 16:35:07

find trade (if findtrade then typesend 'nty, what, where are you, etc'
find duel (if findduel then typesend 'nty')
find pm (must include all colors) (maybe for rcon)
find lvl
find xp
find xp till lvl
find bank (maybe make DTM of bank on minimap)
fighting type (controlled, strength, attack, defence)

get inventory (finds all items in inventory, and assigned a # to each item/slot)

/skills/magic
cast spell

/skills/prayer
turn on/off prayer(s)
prayer time (calculates players prayer level, +prayer bonus, selected prayers to be on, math here math there, = time selected prayers can be on until prayer =0)

JPHamlett

2009-11-26 17:00:51

if anyone is willing to loan me there classic acount for about and hour i could make a few of UNCFANS ideas

uncfan1119

2009-11-26 17:10:25

nvm lol :(

Aut03r

2009-11-26 21:29:57

the find bank one would be awesome :)

wanna start banking ore rather then power mining it hehe

uncfan can you tell me what DTM is..?

JPHamlett

2009-11-26 22:08:26

From: Aut03r
the find bank one would be awesome :)

wanna start banking ore rather then power mining it hehe

uncfan can you tell me what DTM is..?


loan me your account for 1 hour and i can probably have it done for u

Blumblebee

2009-11-26 22:23:44

hmm I think it would be cool to help out on this, problem is I dont have an account, realistically I don't need one but I do need colors. If I could…

a) borrow an account for a bit
or
b) people could collect colors for me

I could make an autocolor.scar or something for classic?

Nava2

2009-11-26 22:58:36

From: Blumblebee
hmm I think it would be cool to help out on this, problem is I dont have an account, realistically I don't need one but I do need colors. If I could…

a) borrow an account for a bit
or
b) people could collect colors for me

I could make an autocolor.scar or something for classic?


Colors are static.

Blumblebee

2009-11-26 23:01:59

From: Nava2
Colors are static.


oh ballin. Then why is it so hard to script for RSC? its just FindColor() and shit would it not?

NCDS

2009-11-26 23:16:32

From: Blumblebee
oh ballin. Then why is it so hard to script for RSC? its just FindColor() and shit would it not?


Yes, I believe that's all it is. Should be pretty easy to build a functioning include.

ZaSz

2009-11-27 01:41:44

Hey, i got a tool I want to add to the include. I think we should have a tools/plugins folder? So can I make the folder? I wanna have this be a decision. I guess between me and you lol.

r4it

2009-11-27 01:58:15

Banking is needed yes… twinkered a little with DTMs n shit… got the window open, but depositing shit isnt that easy :D for me atleast… im a newb.

Awkwardsaw

2009-11-27 08:21:22

From: r4it
Banking is needed yes… twinkered a little with DTMs n shit… got the window open, but depositing shit isnt that easy :D for me atleast… im a newb.


all you really need is to find the slot, and mousebox the depositing :p. i can do it i guess if you send me what you have :D

and JP, you can borrow my account :) you may need to walk a little though, it near port sarim/ rimmy

and zasz, what tool/ plugin is it? :)

uncfan1119

2009-11-27 20:36:28

another to add:

BankDoor; //finds if bank door is open=true, closed=false.

The doors may be different for each bank also. This is very difficult. The bank floor is the same color as the door. So it'd have to rely 100% on the function where it finds the ingame text of open/closed/door

r4it

2009-11-28 06:50:59

From: Awkwardsaw
all you really need is to find the slot, and mousebox the depositing :p. i can do it i guess if you send me what you have :D

and JP, you can borrow my account :) you may need to walk a little though, it near port sarim/ rimmy

and zasz, what tool/ plugin is it? :)


I dont have anything cause i rewrote the script with talking the barmaid next to the bank… bad idea lol… but i could redo it… I just got the DTMs and made it to talk with the banker.
Will start right away… sick of fishing anyway.


program New;
{.Include SRL-rsc/SRL_rsc.scar}
{.include srl/srl/misc/Reports.scar}

const
banker_col = 65536; //color of the banker
ground_col = 143460; //bank floor color on minimap

function Guptext(uptext : string; var x, y : integer): boolean;
var dtm : integer;
begin
case lowercase(uptext) of
'banker' : DTM := DTMFromString('78DA639CC9C0C0C0C98001F8819811CA66EC0' +
'612EC0C58015CCD2A20C14B40CD444C35FFFFA3A959896917BA1A' +
'00E57C074F');
'talk' : DTM := DTMFromString('78DA63CC6664603060C000FC40CC086533466' +
'257C380ACA60AC8D225A0A602C832C1AF0600DE010293');
'answer' : DTM := DTMFromString('78DA635CCBC0C0C0C98001F881981188FF030' +
'1E37220839D012B6084D10F885033014870E3570300C57A06FA');
end;
result := finddtm(dtm, x, y, rssx1, rssy1, rssx2, rssy2);
freedtm(dtm);
end;

procedure IFintalk;
var
x, y : integer;
begin
if Guptext('answer', x, y) then
begin
wait(500 + random(300));
mouse(x, y, 0, 0, true);
wait(500 + random(300));
end;
wait(3000 + random(2000));
end;

procedure TalkBanker;
var
cts, a, x, y : integer;
tpa : TPointArray;
begin
cts := getcolortolerancespeed;
colortolerancespeed(3);
findcolorsspiraltolerance(rsscx, rsscy, tpa, banker_col, rssx1, rssy1, rssx2, rssy2, 2);
if length(tpa) < 50 then exit;
for a := 0 to 50 do
begin
mmouse(tpa[a].x, tpa[a].y, 0, 0);
if Guptext('banker', x, y) then
begin
mouse(tpa[a].x, tpa[a].y, 0, 0, false);
wait(100 + random(200));
if Guptext('talk', x, y) then
begin
mouse(x, y, 20, 5, true);
break;
end else
mmouse(random(100), random(100), 0, 0);
end;
wait(10 + random(100));
end;
wait(2000 + random(500));
IFintalk;
end;

begin
setuprsc;
repeat
TalkBanker;
wait(10 + random(20));
until(false);
end.

It talks and opens the bankwindow over and over… i know its sux, but its the start… i could get it to bank my fish i think.

Antti mies Could u give me the example of walking? :D cause im new to scar scripting and i copy paste most of the shit.

weequ

2009-11-28 07:19:54

We need to get the fonts working :(

Awkwardsaw

2009-11-28 08:26:42

From: antti mies
We need to get the fonts working :(


that we do :(

i'll have a look at it r4it :)

r4it

2009-11-28 08:40:57

From: Awkwardsaw
that we do :(

i'll have a look at it r4it :)


Then u will notice whos script i ripped again ;)

uncfan1119

2009-11-28 12:28:53

Couldn't we just use something like if (IsTextAt (x, y, 'Door: Open')) then

This is from a old script:
procedure LockedIn;
begin
i:= 0; j:= 0; x:= 0; y:= 0;
MoveMouse (460, 15)
Wait (300);
ClickMouse (432, 133, True);
wait (300);
repeat
if (FindColorSpiral (x, y, 929884, 1 + j, 1, 500, 320)) or
(FindColorSpiral (x, y, 415860, 1 + j, 1, 500, 320)) or
(FindColorSpiral (x, y, 1859768, 1 + j, 1, 500, 320)) or
(FindColorSpiral (x, y, 1327248, 1 + j, 1, 500, 320)) or
(FindColorSpiral (x, y, 663624, 1 + j, 1, 500, 320)) then
begin
MoveMouse (x, y);
wait (200);
if (IsTextAt (6, 2, 'Door: Open')) then
begin
ClickMouse (x, y, True);
wait (1000);
end;
end;
i:= i + 1;
if (i = 3) then
begin
i:= 0;
j:= j + 50;
end;
wait (100);
until (j > 501) or (IsTextAt (7, 304, 'The door'));
writeln ('Locked in Check Complete. Continue with Autoing.');
end;

Awkwardsaw

2009-11-28 12:31:35

well, we can, but we still need to load the rsc chars so the function knows what letters to look for :p

uncfan1119

2009-11-28 12:36:11

Oh I thought the SRL text.scar looked through all the text bitmaps no mattter what function :(

r4it

2009-11-28 13:29:10

Iv managed to talk to the banker and bank my tunas lol… with using DTMs and ClickMouse method… are there any better/safer ways to do this?

ZaSz

2009-11-28 13:41:50

I just want to a converter util.

Awkwardsaw

2009-11-29 09:28:48

From: r4it
Iv managed to talk to the banker and bank my tunas lol… with using DTMs and ClickMouse method… are there any better/safer ways to do this?


DONT use clickmouse :) use mouse(x, y, rx, ry, true/false); :p

and what does the converter convert zasz?

r4it

2009-11-29 10:14:48

From: Awkwardsaw
DONT use clickmouse :) use mouse(x, y, rx, ry, true/false); :p

and what does the converter convert zasz?


rx and ry as the cords what scar shows meh right?
I knew that i mustnt use clickmouse… feels kinda detectable.

I managed to talk to banker and open bank window and i managed to bank my fish if bankwindow is open, but i failed when i put these 2 things together.
If i open the bank my self and then start the code what banks my fish it was perfect, but if it talked to banker and then was suppose to bank the fish it clicked on to wrong item and just stood there… dnno why.


program New;
{.Include SRL-rsc/SRL_rsc.scar}
{.include srl/srl/misc/Reports.scar}

const
fish_col = 3757396;

function Guptext(uptext : string; var x, y : integer): boolean;
var dtm : integer;
begin
case lowercase(uptext) of
'tuna' : DTM := DTMFromString('78DA634C626460B8CE8002162F5ECCC00FA41' +
'9A17CC63820EB0EAA9A90504B881C4C4D25907501554D414101AA' +
'9A1020EB2A7E350042900A6C');
'deposit' : DTM := DTMFromString('78DA637CC3C0C0C0C7C8800EF8811824FA1F0' +
'818B7810430D53040D580692146C26A8E020951026A98812C1EFC' +
'6A00BFE406E6');
end;
result := finddtm(dtm, x, y, rssx1, rssy1, rssx2, rssy2);
freedtm(dtm);
end;

procedure DepositAll1;
var
cts, a, x, y : integer;
tpa : TPointArray;
begin
cts := getcolortolerancespeed;
colortolerancespeed(3);
findcolorsspiraltolerance(rsscx, rsscy, tpa, fish_col, rssx1, rssy1, rssx2, rssy2, 2);
if length(tpa) < 50 then exit;
for a := 0 to 50 do
begin
mmouse(tpa[a].x, tpa[a].y, 0, 0);
if Guptext('tuna', x, y) then
begin
mouse(tpa[a].x, tpa[a].y, 0, 0, false);
wait(100 + random(200));
if Guptext('deposit', x, y) then
begin
MoveMouse (427, 295)
wait(300 + random(200));
ClickMouse (427, 294, True);
end else
wait(10 + random(100));
end;
wait(10 + random(100));
end;
wait(2000 + random(500));
end;

begin
setuprsc;
repeat
DepositAll1;
wait(1000 + random(500));
until(false);
end.

I know bitmaping would be better, but i havent figured it out yet.
Its my second or third day twinkering with scar.

Awkwardsaw

2009-11-29 10:34:02

hmm, why dont you just find the dtm of the tuna itsself, instead of finding its color and checking the uptext? :)
i dont know how that would fix the problem, but give it a shot :)

also, you didnt post the actual opening bank procedure

r4it

2009-11-29 11:29:37

From: Awkwardsaw
hmm, why dont you just find the dtm of the tuna itsself, instead of finding its color and checking the uptext? :)
i dont know how that would fix the problem, but give it a shot :)

also, you didnt post the actual opening bank procedure


I tried with tuna DTM 2… wast as good as this.
Posted bank opening before… and it works… kinda good actually.
I havent been able to open bank and then bank shit… i think you could help me there… i think i mess up some loops or something… and i dont know alot of commands.
Did u add me to msn yet?


program New;
{.Include SRL-rsc/SRL_rsc.scar}
{.include srl/srl/misc/Reports.scar}

const
banker_col = 65536; //color of the banker
fish_col = 7368816;

function Guptext(uptext : string; var x, y : integer): boolean;
var dtm : integer;
begin
case lowercase(uptext) of
'banker' : DTM := DTMFromString('78DA639CC9C0C0C0C98001F8819811CA66EC0' +
'612EC0C58015CCD2A20C14B40CD444C35FFFFA3A959896917BA1A' +
'00E57C074F');
'talk' : DTM := DTMFromString('78DA63CC6664603060C000FC40CC086533466' +
'257C380ACA60AC8D225A0A602C832C1AF0600DE010293');
'answer' : DTM := DTMFromString('78DA635CCBC0C0C0C98001F881981188FF030' +
'1E37220839D012B6084D10F885033014870E3570300C57A06FA');
'tuna' : DTM := DTMFromString('78DA634C626460B8CE8002162F5ECCC00FA41' +
'9A17CC63820EB0EAA9A90504B881C4C4D25907501554D414101AA' +
'9A1020EB2A7E350042900A6C');
'deposit' : DTM := DTMFromString('78DA637CC3C0C0C0C7C8800EF8811824FA1F0' +
'818B7810430D53040D580692146C26A8E020951026A98812C1EFC' +
'6A00BFE406E6');
end;
result := finddtm(dtm, x, y, rssx1, rssy1, rssx2, rssy2);
freedtm(dtm);
end;

procedure DepositAll1;
var
cts, a, x, y : integer;
tpa : TPointArray;
begin
cts := getcolortolerancespeed;
colortolerancespeed(3);
findcolorsspiraltolerance(rsscx, rsscy, tpa, fish_col, rssx1, rssy1, rssx2, rssy2, 2);
if length(tpa) < 50 then exit;
for a := 0 to 50 do
begin
mmouse(tpa[a].x, tpa[a].y, 0, 0);
if Guptext('tuna', x, y) then
begin
mouse(tpa[a].x, tpa[a].y, 0, 0, false);
wait(100 + random(200));
if Guptext('deposit', x, y) then
begin
MoveMouse (427, 295)
wait(300 + random(200));
ClickMouse (427, 294, True);
end else
wait(10 + random(100));
end;
wait(10 + random(100));
end;
wait(2000 + random(500));
end;

procedure IFintalk;
var
x, y : integer;
begin
if not Guptext('answer', x, y) then
exit;
while Guptext('answer', x, y) do
begin
wait(1000 + random(1000));
mouse(x, y, 0, 0, true);
wait(10000 + random(500));
end;
wait(700 + random(453));
DepositAll1;
end;

procedure TalkBanker;
var
cts, a, x, y : integer;
tpa : TPointArray;
begin
cts := getcolortolerancespeed;
colortolerancespeed(3);
findcolorsspiraltolerance(rsscx, rsscy, tpa, banker_col, rssx1, rssy1, rssx2, rssy2, 2);
if length(tpa) < 50 then exit;
for a := 0 to 50 do
begin
mmouse(tpa[a].x, tpa[a].y, 0, 0);
if Guptext('banker', x, y) then
begin
mouse(tpa[a].x, tpa[a].y, 0, 0, false);
wait(100 + random(200));
if Guptext('talk', x, y) then
begin
wait(100 + random(200));
mouse(x, y, 20, 5, true);
break;
end;
wait(100 + random(100));
end;
wait(100 + random(100));
end;
wait(3000 + random(500));
IFintalk;
end;

begin
setuprsc;
repeat
TalkBanker;
wait(10 + random(20));
until(false);
end.

I think that peace of code was the one i was testing yesterday… dont remember cause i was tierd and high and got frustrated lol.

Im not at failsafes yet… all these ifs and thens are confusing me lol.
Copy paste coding sucks… but atleast im trying ^^

Awkwardsaw

2009-11-29 11:50:10

add in some writeln's so you know exactly where it messes up, also make a "while (not bankscreenopen) do wait(100 + random(10));" function right after you finish talking, and before you deposit. also add in the fail safe before you deposit :)

r4it

2009-11-29 13:13:26

From: Awkwardsaw
add in some writeln's so you know exactly where it messes up, also make a "while (not bankscreenopen) do wait(100 + random(10));" function right after you finish talking, and before you deposit. also add in the fail safe before you deposit :)


Will start with it toworrow i think… training combat atm :D
Tyvm for suggestions.

Edit:

I still dont have no idea how to do walking without it being detected.
Walking is done with mmouse and cordinates?