View Full Version : First script help
mikev
09-01-2006, 03:33 AM
Hi,
I have been reading all the tutorials and have messed around with mayn of the free SRL scripts generously made by this awesome community.
Any ways, I was following a tutorial which tought me to make this script:
Program Autotyper;
var message: string;
Procedure setup;
begin
message:='hello!!!'
end;
procedure typing;
begin
sendkeys(message + chr(13));
end;
begin
setup;
repeat
typing;
wait(2000)
until(false)
end.
I was wondering how I make it type in the actual runescape client.....if there is a tutorial on how this is done, please link me to it.
Right now it only types in Scar where the cursor is located.
thanks,
mikev
aznrx
09-01-2006, 04:07 AM
Good start on scripting mikev.
i will tell you what to do =)
Program Autotyper;
var message: string;
Procedure setup;
begin
message:='hello!!!'
end;
procedure typing;
begin
sendkeys(message + chr(13));
end;
begin
setup;
repeat
typing;
wait(2000)
until(false)
end.
my changes will make it a lot neater and easier to read
changes to ...
Program Autotyper;
var message: string;
Procedure setup;
begin
message:='hello!!!'
end;
change to...
Program Autotyper;
const
message= 'Hello' ; // the Const makes 'message' the same for the whole script.
================================================== ==
procedure typing;
begin
sendkeys(message + chr(13));
end;
no need to change. Since message is a constant it will type 'Hello'
================================================== ==
begin
setup;
repeat
typing;
wait(2000)
until(false)
change to...
begin
ActivateClient; // brings up specifed client window(hides scar and brings up client), in this case runescape.
repeat
typing;
wait(2000+random(1132+2)) // makes it more random
until(false)
hope that helped
oh and end note...
Messing around with scripts and experimenting with procedures and functions is the best way to learn
mikev
09-01-2006, 04:15 AM
Hi,
thanks so much for the quick and helpful reply. I really appreciate you taking your time to help me.
I made the changes to the script.
I drag the crosshair to the rs2 client but it still types in scar where the cursor is located.
Thanks for the help,
mikev
aznrx
09-01-2006, 04:24 AM
hmm does your end script (with changes) look like this?
Program Autotyper;
const
message = 'hello' ;
procedure typing;
begin
sendkeys(message + chr(13));
end;
begin
ActivateClient;
wait(5000); // while this is waiting, click your mouse onto the runescape chat input thingy.
repeat
typing;
wait(2000+random(1123+23));
until(false)
end.
mikev
09-01-2006, 04:29 AM
:eek: :eek: :tongue: Yeah....I didn't see that last code box with the "Activateclient" part.
sry bout the confusion. Thanks again for the quick and helpful reply.
mikev
aznrx
09-01-2006, 04:39 AM
yup just trying to help all begginer scar scripters. :cool:
mikev
09-01-2006, 04:44 AM
I have 1 more quick question. To see a list of all the procedures and Functions, do i look at procedureparams text document that came with scar? It seems kinda short if thats all of them.
thanks,
mikev
aznrx
09-01-2006, 04:50 AM
yup sure it doesnt hurt to look at them.
or you could press Ctrl + [the spacebar]
mikev
09-01-2006, 05:45 AM
ok, I was trying to follow a TUT and kinda make my own stuff here and there if I could, but Im stuck on this one... the TUT i was following can be found here...i was trying to use a different mining procedure .... I think its because of the new SRL but im not sure.
well n e wayz, the tut uses a procedure called
Procedure dropal;
begin
dropto(2-28);
end;
but I want to use a procedure I fould in SRL.
program autoclicker;
{.include SRL/SRL.scar}
const rock=254216;
const rockwait=9000;
procedure mining;
begin
repeat
findcolorspiral(x,y,rock,3,3,515,336)
istextat2(9,9,'Mine',20)
mouse(x,y,2,2,true)
wait(rockwait+random(300))
until(invfull)
if (invfull = true) then
end;
procedure dropall;
var
i: Integer;
begin
for i := 2 to 28 do
DropItem(i);
end;
begin
SetupSRL;
repeat
mine;
dropall;
until(false)
end.
this is what i have so far.
Failed when compiling
Line 18: [Error] (14266:11): Duplicate identifier 'DROPALL' in script
^^thats the error I get :/
the tut can be found at http://www.moparisthebest.com/smf/index.php/topic,10321.0.html
thanks for the help,
mikev
Sumilion
09-01-2006, 11:55 AM
Change DropAll to DropAllOres, since DropAll already exists in SRL you cant make another :)
mikev
09-01-2006, 01:41 PM
ok, ty vm. sorry about the late reply, had to sleep. Could you explain why this is? I will do as you said, but I wanna understand the reasons behind action. I thought scar was telling me that Dropall was used twice in the script or sumthing. :tongue:
Also is there a way to avoid the kinda mistake I have made....I thought that if I include the "include" SRL, I could use the helpful code and procedures in it.
1 more question, I wanted to try and use the function "istextat" and "mouse" to make a simple antirandom kinda thing....I just wanna see if it can pickup a nickname and right click the random. Of course, I have no clue how to do this in my script....help plz :)
sorry if thats not very clear, I wouldn't blame you if you don't understand my question because thats kinda how cluttered my mind is rite now lol.
thanks,
mikev
Sumilion
09-01-2006, 04:17 PM
Well i don't have a fluffy sweet bear for nothing :biggrin: , tho i already said it in my last post ;), DropAll is already made in SRL, so somewhere along the includes, there is a Function/Procedure DropAll; So when you make another one the script doesn't know wich one to choose so it just doesnt and say this error. Err, yeah, a way to avoid it... well i suppose you can check the manual for all of the functions, but then again just creating one and changing if it already exists is faster :). If i want to make a function/procedure i will most likely put My in it if i'm guessing it exists. Like OpenMyBank; or OpenMyFurnace; or DropMyOres;. About the antirandom thing, i don't know about istextat, never used it, mouse on the other hand is easy, but you probably figured that one out :rolleyes: .
However you could try :
If(IsTextAt(x, y, 'ilion')Then
Begin
Mouse(x, y, 5, 5, false);
ChooseOption(x, y, 'ancel')
End;
This will find the text 'ilion', perhaps on the screen, i don't know how it works, and then it gives the coords of the find spot to x, y then Mouse clicks on x, y and then it chooses the option Cancel if it exists. you can change 'ilion' with your username, or if you don't want to have the troubles of keep changing this, you can change 'ilion' with IntToStr(Player[CurrentPlayer].Username) or something like that :), but remember that if you do this dont use the ''.
Remember, this is only a wild gues, i never used this :)
mikev
09-02-2006, 12:37 AM
kk, I just got my pc working<---needed new motherboard :mad: I'm gonna go see what you said will work.
Thanks for the quick and helpful reply,
mikev
p.s. congrats on teddy bear award :tongue: You definately live up to it.:wink:
mikev
09-02-2006, 03:01 PM
took me a couple minutes to figure this 1 out but n e ways...u threw me off with a missing ")" in this line If(IsTextAt(x, y, 'ilion')Then but I eventually got it.
I have yet another question now :) how can I make my anti-random scan for text every second? Or should I just put the procedure in the main loop under repeat?
heres the code so far
program autoclicker;
{.include SRL/SRL.scar}
const rock=254216;
const rockwait=9000;
procedure mining;
begin
repeat
findcolorspiral(x,y,rock,3,3,515,336)
istextat2(9,9,'Mine',20)
mouse(x,y,2,2,true)
wait(rockwait+random(300))
until(invfull)
if (invfull = true) then
end;
procedure dropallore;
var
i: Integer;
begin
for i := 2 to 28 do
DropItem(i);
end;
procedure antis;
begin
If (IsTextAt(x, y, 'urnal')) Then
Mouse(x, y, 5, 5, false);
ChooseOption(x, y, 'alk to')
End;
begin
SetupSRL;
repeat
mining;
dropallore;
until(false)
end.
thanks,
mikev
aznrx
09-02-2006, 03:03 PM
you can put your antis procedure in a repeat loop.
Sumilion
09-02-2006, 04:06 PM
Indeed, i got something from c0de somtime that calls up FindNormalRandoms every ??? seconds. But it screwed up my entire script, but it's possible..., by the way aznrx, where is Garbage located :rolleyes:
aznrx
09-03-2006, 07:52 AM
garbage is located at the back of your house :cool:
Sumilion
09-03-2006, 07:59 AM
=O, you mean my bro's room, do you live together? :rolleyes:
aznrx
09-03-2006, 08:04 AM
hah yes! indeed i live with your brother.
we better stop spamming mikevs thread before he gets angry :rolleyes:
mikev
09-03-2006, 03:29 PM
I don't care guys, you helped me out a bunch, thanks again!
ALSO: I need help implementing SRL stuff into my autominer :/ ...... I just can't get the hang of it.
My script remains the same from my last post showing the entire script. I wanted to use some of the autotalk scripts located in the core folder in SRL. Can Any one give me an example of how I would use those in my script
(e.g.) where to paste them, and how to set them up.
thanks so much,
mikev
mikev
09-04-2006, 12:38 AM
some 1 lives with sum 1's bro?? wtf lol
Sumilion
09-04-2006, 12:42 PM
Hihihi, lol, he stated as where he lives 'Garbage', so i asked.... errr where is Garbage, as a joke, then he said, behind your house, since my bro is a complete mess, i thought they were living together, and apparently they are... gay :p
mikev
09-04-2006, 01:50 PM
sumilion plz help me lol, I think you missed my edited post on page 1. I've just been stuck for a day on it and really want to get sum help lol
thanks,
mikev
Sumilion
09-04-2006, 03:07 PM
I wish i could help you, but i never worked with autotalkers, the only thing i know is that TypeSend('blabla'); types blabla in runescape... sorry :redface:
mikev
09-04-2006, 10:41 PM
I don't care guys, you helped me out a bunch, thanks again!
ALSO: I need help implementing SRL stuff into my autominer :/ ...... I just can't get the hang of it.
My script remains the same from my last post showing the entire script. I wanted to use some of the autotalk scripts located in the core folder in SRL. Can Any one give me an example of how I would use those in my script
(e.g.) where to paste them, and how to set them up.
thanks so much,
mikev
Could you help me with this? plz?
thanks so much,
mikev
mikev
09-09-2006, 02:09 PM
still need help, got a few questions, if any one could help me on msn, that would be soo great! Please, I just need help getting the basics lol
thanks,
mikev
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.