Log in

View Full Version : SRL commands



dagger5678
02-16-2007, 09:41 PM
Anyone know how to make a script go on forever? I think it's something like:


until(false)
end.
But it doesn't work.

And I need to know how to make it double click... I can't find it in the manual. Thanks.:spongebob:

JAD
02-16-2007, 09:51 PM
you need to put something like this in the main loop. example:

begin
repeat
//procedure
//procedure
until(false)
end.

so just put all the things you want in the main loop between repeat and until(false) for that. and as for making it double click you could use an SRL command like this. example:

procedure DoubleClick;
var x,y integer:
begin
if(FindColor(x,y,color,cord,cord,cord,cord) then
begin
MMouse(x,y,0,0) //moves mouse to specified location.
wait(50+random(500)) //waits random mil. to make script less detectable
Mouse(x,y,true) //clicks mouse once
wait(15+random(5)) //waits random mil. to make script less detectable
Mouse(x,y,true) //clicks second time
end;
begin
DoubleClick;
end.

so that should do it. you should read some tuts though because thats some basic stuff that you'd learn in tutorials. if you need anymore help just ask, and I'll be more then happy to help however i can :)

dagger5678
02-16-2007, 10:15 PM
*script UPDATED on Saturday, February 12, 2007*


{MAWler v1((MAximizeWindowsmediaplayerler v1)lame name, I know)
CREATED BY
DAGGER5678
basically the first real script I made ever, credit to solemn wishes on his
tutorial on how to make a PowerMiner, I just modified it to suit my needs.
For Windows Media Player 9 ONLY... eliminates the pesky problem of it exiting
full-screen for no reason at all.
-Made on Thursday, February 15th, 2007.}

{SUPPORT THE SRL FORUMS COMMUNITY! Sign up now! http://www.srl-forums.com/}

program StopWMfromMinimizing;

var x,y,BitmapPaintIcon,FullScreen:integer;

const
buttoncolor= 7431260;

procedure FindTheIcon;

begin

if(FindColorSpiralTolerance(x,y,buttoncolor,5,5,51 4,337,2))then

begin

MoveMouseSmooth(x,y) //moves mouse to icon
wait(100)//just wait a sec...
writeln('Waiting is over...')
end;
if(FindBitmapToleranceIn(BitmapPaintIcon,x,y,6,6,1 26,23,1))then //this is bitmap

begin

GetMousePos(x,y)//gets position of mouse
MoveMouseSmooth(513,269)
ClickMouse(x,y,false)
if(FindColorSpiralTolerance(x,y,FullScreen,5,5,514 ,337,2))then
ClickMouse(x,y,true)//Hurrah! Full Screen goodness!
writeln('Hurrah! Succesful... or not. Whatever.')
end;
end;

procedure LoadBitmaps;

begin
BitmapPaintIcon := BitmapFromString(23, 22, 'z78DAED564BB2E' +
'4360CBB926589BF254991F73FD240F64BAA926CD2F3D93D2D D4DD' +
'6AAB080120E4EBFA1E3F3FCCFC8A69B7A97370ECA4DABDDAF 7DC5' +
'9232239DDCA3586B88A5DDC126A5AD817BF0D03597AA37AE2 433A' +
'BA319F61CFACCFBC9EF93AFF46676EF20849022A3251B3E5F A2B1' +
'87CE28C0904F7BE7A34753D38FA9DAB8088DFF9C553DDDE4D C6CC' +
'BD2F70E5C63E628AE932D5FE197A346DFAC4E9680FD49A387 FFE8' +
'D010B40351E4EF6CB4C1D8642D9A0A20DDB8EC2E061E5DE5E 014D' +
'3B6EE8E55A1F2339BBB356196ABC18DE59F0A90F9E8016DC3 766C' +
'3CA998B266D16A0C420E52954779D4709AC1287B0FA61C63F C063' +
'617D363DF55F0C04E6F9F91E2065BD9EF8CB2DCA7858CF1EB 8C3F' +
'62AE58226BDB9663356B8A090B64F7621B50F1CC26E71FF83 8D7F' +
'73D2E81DC2EFC7213317D17AD9E08B5D67CD7A36EDE8B1C14 D93D' +
'FBE7350B2C8274804480827175820BFCEBEFFE358C2A189B7 389D' +
'0A38FE0A9EE91B2E020BE8A73D814172EEABA64BDC007C43C 1FE4' +
'09D61E4A3A24E97E6579F1E2C47A3A314D6507BC97879A8E3 E09E' +
'B592912BDBA048800D0227C0FBE0414BA10716FCB364FD7F2 452E' +
'8BBB56947C91703B3BC5771411DF8D0DA48F89655032AF572 52B9' +
'69A24A65A1EE060BA323173C13A95BCAE1D7690BFE71F50F9 0882' +
'4FCC59E017151B9507B3C1E3966211D36E05960001E919ABA 9C6F' +
'C883CC43DD022705750219803564CA9D37052B42CE4F467FD ACBB' +
'0A320152A38E793187DDBA4452019D149170C8BC4724FA4D8 5167' +
'9F94EB2DE8EDC6095651F4063EB02126E862D59F4C5AA4D3F 04B2' +
'F3D5979035122A7006F3FE186BA1718D8C793F5F472D0D124 4ECF' +
'AE5020B9C1D75650204387AF18397E25F3919CB75F3891808 8CB4' +
'E68E202D8150B39917132432D4313F7227CC58647F3220703 5044' +
'8634F27AC582CA70D76FB80791E061E74E118133A72041815 1F11' +
'B20C0FF46DB9F345B8B79C20A0CD723AAD143F6E7DE10C089 6CC1' +
'0DADA140831B0AFA093268C6CCEF17A8EFF107C70FDD5E809 E');

FullScreen := BitmapFromString(142, 43, 'z78DAEDD9C195C3200' +
'C40C1965C45FA2F29D75CE0090458B167AE9B176FD07EB0B3 D705' +
'0000000000ACF18117D314680A34059AD214680A34059AAAD 3D4E' +
'FB5B4BC6F6DA9DFD4AA1E479B72AAB656E3CC7EB563EE9ADA 31A3' +
'C87BDA75CF3475660A9A9A5B93D159AF9A66EBB3F4AF15598 1FE6' +
'B4E9EA1ADABF7D739F25BE5A7105987FC4F77B759F3DE6F6D 53A3' +
'AB1DDFD533FBFCE86BEE6D6AD539353785CC5AB5F607E754B EA91' +
'D778FF1FD21BF87546B6AF4EF61C7DC57EDD59AAAD6D499CF 7B66' +
'D6F73E4FED3ED335F5BF4DD5BCF78B7FC62735E59C8ADF818 F169' +
'1F92661F4FD573DCD55682AFE24323785B95EF2DF513CA929 78CF' +
'FF2934059A024D81A634059A024D81A634059A024D81A6AC2 A9AD' +
'214546E0A000000000000F2BE82348ECC');

end;


begin

LoadBitmaps;

repeat

FindTheIcon;

until(isfkeydown(5))//change to whatever F Key you want

end.

PS: SmartzKid, you really live up to your name. ;)

omgh4x0rz
02-17-2007, 02:24 AM
You want this
WARNING: Use endless loops carefully! Not only can they leave your script hanging and get you banned in rs, but having certain movemouse procedures run endlessly will really mess your head trying to stop!


begin
LoadBitmaps;
repeat//starts the endless repeat of FindTheIcon
FindTheIcon;
until (false) //sets the end for the repeat. False=infinite loops
end.



Have you tested this script though, you seem to have a procedure just sitting out there in no man's land being unnamed.

JAD
02-17-2007, 04:04 AM
oh and if you want the SRL manual just go to the SRL download tutorial, and download the manual there. that will teach you a lot of SRL commands, helped me a lot.

Smartzkid
02-17-2007, 04:19 AM
Well I don't have WMP 9 so I can't really test it, but heres how I'd impliment it:

Oh, and by the way...you need to add in the FullScreen bitmap at line 57, the old one was corrupt.


program StopWMfromMinimizing;
var x,y,BitmapPaintIcon,FullScreen:integer;
const
buttoncolor= 7431260;

procedure FindTheIcon;
begin
if(FindColorSpiralTolerance(x,y,buttoncolor,5,5,51 4,337,2))then
begin
MoveMouseSmooth(x,y); //moves mouse to icon
wait(100);//just wait a sec...
writeln('Waiting is over...');
end;
if(FindBitmapToleranceIn(BitmapPaintIcon,x,y,6,6,1 26,23,1))then //this uses the bitmap
begin
getmousepos(x,y)//gets position of mouse
MoveMouseSmooth(513,269)
ClickMouse(x,y,false)
if(FindColorSpiralTolerance(x,y,FullScreen,5,5,514 ,337,2))then
ClickMouse(x,y,true)//Hurrah! Full Screen goodness!
writeln('Hurrah! Succesful... or not. Whatever.')
end;
end;

procedure LoadBitmaps;
begin
BitmapPaintIcon := BitmapFromString(23, 22, 'z78DAED564BB2E' +
'4360CBB926589BF254991F73FD240F64BAA926CD2F3D93D2D D4DD' +
'6AAB080120E4EBFA1E3F3FCCFC8A69B7A97370ECA4DABDDAF 7DC5' +
'9232239DDCA3586B88A5DDC126A5AD817BF0D03597AA37AE2 433A' +
'BA319F61CFACCFBC9EF93AFF46676EF20849022A3251B3E5F A2B1' +
'87CE28C0904F7BE7A34753D38FA9DAB8088DFF9C553DDDE4D C6CC' +
'BD2F70E5C63E628AE932D5FE197A346DFAC4E9680FD49A387 FFE8' +
'D010B40351E4EF6CB4C1D8642D9A0A20DDB8EC2E061E5DE5E 014D' +
'3B6EE8E55A1F2339BBB356196ABC18DE59F0A90F9E8016DC3 766C' +
'3CA998B266D16A0C420E52954779D4709AC1287B0FA61C63F C063' +
'617D363DF55F0C04E6F9F91E2065BD9EF8CB2DCA7858CF1EB 8C3F' +
'62AE58226BDB9663356B8A090B64F7621B50F1CC26E71FF83 8D7F' +
'73D2E81DC2EFC7213317D17AD9E08B5D67CD7A36EDE8B1C14 D93D' +
'FBE7350B2C8274804480827175820BFCEBEFFE358C2A189B7 389D' +
'0A38FE0A9EE91B2E020BE8A73D814172EEABA64BDC007C43C 1FE4' +
'09D61E4A3A24E97E6579F1E2C47A3A314D6507BC97879A8E3 E09E' +
'B592912BDBA048800D0227C0FBE0414BA10716FCB364FD7F2 452E' +
'8BBB56947C91703B3BC5771411DF8D0DA48F89655032AF572 52B9' +
'69A24A65A1EE060BA323173C13A95BCAE1D7690BFE71F50F9 0882' +
'4FCC59E017151B9507B3C1E3966211D36E05960001E919ABA 9C6F' +
'C883CC43DD022705750219803564CA9D37052B42CE4F467FD ACBB' +
'0A320152A38E793187DDBA4452019D149170C8BC4724FA4D8 5167' +
'9F94EB2DE8EDC6095651F4063EB02126E862D59F4C5AA4D3F 04B2' +
'F3D5979035122A7006F3FE186BA1718D8C793F5F472D0D124 4ECF' +
'AE5020B9C1D75650204387AF18397E25F3919CB75F3891808 8CB4' +
'E68E202D8150B39917132432D4313F7227CC58647F3220703 5044' +
'8634F27AC582CA70D76FB80791E061E74E118133A72041815 1F11' +
'B20C0FF46DB9F345B8B79C20A0CD723AAD143F6E7DE10C089 6CC1' +
'0DADA140831B0AFA093268C6CCEF17A8EFF107C70FDD5E809 E');

FullScreen:=//NEEDS TO BE RE-GOTTEN;
end;

begin
LoadBitmaps;
repeat
FindTheIcon;
until(isfkeydown(12)) //switch to any number between 1 and 12 if you like
end.

dagger5678
02-17-2007, 08:11 PM
Ok thanks everyone, I'll be sure to try your ideas and suggestions.

dagger5678
02-17-2007, 09:39 PM
It doesn't work so far... Doesn't move to the icon it's supposed to. Here's what the script is supposed to do:

If the WM Player exits Full Screen, a button appears that you can only see when not in Full Screen mode. It moves over to it, and confirms it's actually there, and then moves to the middle of the screen where the movie is playing, and right-clicks, finds the Bitmap that has this inside it: Full Screen Alt-Enter, and left-clicks on it and then... voila! Instant full screen...

Well, that's how it's supposed to work... I really need someone to help me fix it. I'll give credit to whoever that helps.