OK is it possible to store information like "mouse(x, y, 10, true);" in a varible and have scar run it?
OK is it possible to store information like "mouse(x, y, 10, true);" in a varible and have scar run it?
what exactly do you mean?
you can use procedures and functions to store things:
notice how "mine rock" is the first procedure, and then i call the procedure during "mining"Code:procedure minerock; var clayTPA : TPointArray; clayATPA : T2DPointArray; i,h,mousex,mousey : Integer; begin if (findcolorstolerance(clayTPA,findclaycolor, msx1+2, msy1+2, msx2-2, msy2-2,20)) then begin clayATPA:=TPAtoATPA(clayTPA,20); h:= high(clayATPA); for i := 0 to h do begin MiddleTPAEX(clayATPA[i],x,y); mmouse(x,y,3,3); wait(100+random(50)); if isuptext('ine') then begin mouse(x,y,3,3,true); getmousepos(mousex,mousey); Wait(100+random(50)); mmouse(random(x),random(y),3,3); while (findcolortolerance(x,y,findclaycolor, mousex-7, mousey-7, mousex+7, mousey+7,20)) do begin wait(500+random(100)); end; exit; end; end; end; end; procedure mining; begin while not (invfull) do begin wait(1400+random(150)); minerock; end; end;
is this what your are talking about?
You may contact me with any concerns you have.
Are you a victim of harassment? Please notify me or any other staff member.
| SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |
I mean, lets say s := "mouse(x, y, 10, true);"
then you do a fucntion or somthing that tells scar to run what s equals is this possible?
(also does anyone know why a saved scar file would go blank!?)
umm if you REALLY need to have S only run "mouse(x,y,3,3,true);" then i would just use a procedure.
edit: you could use types and assign the variable the procedure... but i don't understand how that would be more helpfulCode:procedure s; begin mouse(x,y,3,3,true); fflag(2); end; procedure findS; begin if (findcolortolerance(x,y,findcolor, msx1, msy1, msx2, msy2,20)) then begin s; end; end;
Last edited by x[Warrior]x3500; 08-29-2009 at 03:11 PM.
ok but do you know if it's possible i wanted to know for grabbing code using the getpage() fuction so theres no need to update but ok
it is possible. use the guide provided by Dan. but i still don't see why regular procs/functions won't work xD
ok also umm is there any reaosn a scar script would go blank without you deleeting it becouse i think i have to redo it becouse my whole script wont show up ):
highlight everything and see if it works
that sometimes happens to me
SCAR Code:program New;
var s: Procedure;
Procedure DoShit;
var x, y: Integer;
begin
Mouse(x, y, 5, 5, True);
Blah...Blah;
emd;
begin
s := @DoShit;
s;
end.
if this is what you meant (procedure/function variables)
“Ignorance, the root and the stem of every evil.”
gahh doesnt matter i got to redo a weeks worth of scipting -_-
simple reasoning, say you have a multi-tasking script, or multi-location now you can have a variable that holds a function and have 5 different functions for each skill/location. Now you can set the variable to the function that is equivelant to the task/loc and viola saves lines and time, and looks confusing
really, there isnt much point to it, it just looks nice and sometimes can help for organization purposes/ save lines.
“Ignorance, the root and the stem of every evil.”
ahh kk... i am understanding now... but u could also use cases inside of a function one(num:integer): integer; with num being the case number.lol i will stop.
sure you would declare it the same but then it would look like so:
SCAR Code:program New;
var s: Function(Index:Integer): Boolean;
Function DoThisOrThat(Index: Integer): Boolean;
begin
case Integer of
0: dothis;
1: dothat;
end;
Result := Dothis or Dothat;
end;
begin
s := @DoThisOrThat;
s(0);
end.
“Ignorance, the root and the stem of every evil.”
xD lol kk. it would save 2 lines by just getting rid of S and putting dothisorthat(0); :P alright i am off for the night
no i mean ok I make a site that says Mouse(x, y, 10, true); then i use s := getpage(); then theres a code that runs what s equals is this possible?
oh! ok. so originally you were giving S a valueless procedure ( mouse(); )... but you are saying that you want to give S a function with a value and then present that value to the user.
yes setting a string to := getpage() would work
Last edited by x[Warrior]x3500; 08-30-2009 at 04:52 AM.
yes but is it possible to run that value so that a page can have many lines of code
and have the code on it be ran?
also is silent mouse possible still.(not for cheating has other purpose)
There are currently 1 users browsing this thread. (0 members and 1 guests)