SRL Archive - OSR Help

Heres my simba scrip any sugestions?


wantonman

2011-08-01 03:39:55

program Autoer;
var
x,y:integer;


function find_loghead:boolean;
var
x,y:integer;
begin
repeat
findcolor(x,y,3303273,0,0,800,620)
until(false);
end;




procedure Click_loghead;
begin
if
find_loghead
then
movemouse(x,y);
end;




begin
activateclient;
repeat
click_loghead;
until(false);
end.

Heavenzeyez1

2011-08-01 03:45:52

function find_loghead:boolean;
var
x,y: integer;
begin // this will set the boolean true or false, if it finds then the result is true.
result := findcolor(x,y,3303273,0,0,800,620);
end;
~Eerik.

E: Try Including SRL also, read tutorials, and your click_log won't click, it will only move the mouse there. Try using Mouse or ClickMouse

Flight

2011-08-01 03:51:41

Here ya go:


program Autoer;
{$i srl/srl.scar}

Var
X,Y,T: integer;


function find_loghead:boolean;
begin
repeat
if findcolor(X,Y,3303273,0,0,800,620) then
Result := True;
until(Result);
end;


procedure Click_loghead;
begin
if find_loghead then
begin
MMouse(X,Y,0,0);
ClickMouse2(True);
end;
end;


begin
activateclient;
MarkTime(T);
repeat
if (TimeFromMark(T) >= 10000) then //10 seconds
TerminateScript; //Stops the script after 10 seconds, just incase something goes wrong
click_loghead;
until(false);
end.

wantonman

2011-08-01 03:57:21

thank you for helping, my main concern was that resut= thing… yeah a little different from scar but so far i already see the advantages simba has over scar… he is the king lol!

wantonman

2011-08-01 04:55:58

With all your revisions and faqs Ive made a version of mine


program Autoer;
var
x,y:integer;


function func1:boolean;
begin
result := findcolor(x,y,3303273,0,0,800,620);
end;




procedure proced1;
begin
repeat
func1
until(true);
movemouse(x,y);
clickmouse(x,y,1);
end;





begin
activateclient;
repeat
proced1;
until(false);
end.



this is just a little code chunk whithout anything you can call this the core

Heavenzeyez1

2011-08-01 05:14:10


repeat
func1
until(true);
It should be something like:

repeat
DoSomething; //For example wait.
until(Func1);

~Eerik.

wantonman

2011-08-01 05:23:06


repeat
func1
until(func1);

because func1 is the boolean I get it, cool thanks!

Flight

2011-08-01 05:27:48

Just as a heads up, because you're not using SMART, this will take control of your mouse, and it you have it moving infinitely it'll be a real pain to stop that. For testing purposes, you might want to put a number limit or time limit before the script stops.

wantonman

2011-08-01 05:36:55

will do, will do. Thanks

Jakkle

2011-08-01 05:43:51

You can stop a script by pressing alt tab until you got simba up then F2 to stop the script ? if you didn't have a timer that is :p

Smarter Child

2011-08-01 06:12:08

From: Jakkle
You can stop a script by pressing alt tab until you got simba up then F2 to stop the script ? if you didn't have a timer that is :p


Sometimes [especially with MoveMouse] you will find yourself fighting the Mouse, ALT + TAB + F2 may not always work if things get crazy :p

Therefore, a Timer or some form of fail safe to break the [endless] loops can really save you a lot of headache.
~ Past experiences ;)

BraK

2011-08-01 06:21:18

I'd also like to recommend using proper Scripting standards. It makes your work Easier to read for others to help you with. To learn the proper standards here is a tut by Shuttleu.

~BraK