SRL Archive - SRL Archives

Function ResizeOff;


Dynamite

2009-10-04 23:36:35

OK well as many people know it gets annoying to have to click the resize client thing, especially for people who don't know you have to…
So I made ResizeOff which will click the resize button if it is on.

Function ResizeOff;
begin
if FindColor(x, y, 2302956, MSX1, MSY1, MSX2, MSY2) then
end else
begin
ResizeDTM := DTMFromString('78DA63E467606010664001E989E6609A11CA6' +
'76407125CA86A9AAA8350D570000949543596560EA86A4076C9A0' +
'AA3132B240552386698EA6A61EAA1A1120C14FC03D20796E54358' +
'E360A286A009D440703');
Result := FindDTM(ResizeDTM, x, y, x1, y1, x2, y2);
If Not Result then
Wait(1000);
If Result then
Mouse(x, y, 4, 4, True);
wait(500);
begin
if FindColor(x, y, 2302956, MSX1, MSY1, MSX2, MSY2) then
end;
end;

Please give feedback :)

T~M

Rich

2009-10-04 23:39:05

Is this the little button thingy in the bottom left of the login screen? If so:
{*******************************************************************************
function IsLoginStill : Boolean;
By: R1ch
Description: Returns true if the login page is still
*******************************************************************************}
function IsLoginStill : Boolean;
begin
if LoggedIn then Exit;
Result:= GetColor(16, 487) = 2302956;
end;

{*******************************************************************************
function MakeLoginStill(Still : Boolean) : Boolean;
By: R1ch
Description: Makes login page still, depending on Still
*******************************************************************************}
function MakeLoginStill(Still : Boolean) : Boolean;
begin
if LoggedIn then Exit;
if not (IsLoginStill xor Still) then
Mouse(16, 487, 7, 7, True);
Result:= True;
end;
I made them ages ago, but no one took any notice.

EDIT: Changed yours around a bit:

function ResizeOff;
var
ResizeDTM : Integer;
begin
if not FindColor(x, y, 2302956, MSX1, MSY1, MSX2, MSY2) then
begin
ResizeDTM:= DTMFromString('78DA63E467606010664001E989E6609A11CA6' +
'76407125CA86A9AAA8350D570000949543596560EA86A4076C9A0' +
'AA3132B240552386698EA6A61EAA1A1120C14FC03D20796E54358' +
'E360A286A009D440703');
Result:= FindDTM(ResizeDTM, X, Y, X1, Y1, X2, Y2);
if not Result then
Wait(1000);
if Result then
Mouse(X, Y, 5, 5, True);
Wait(500);
end;
end;

Neehosoft

2009-10-04 23:41:44

Resize what client?

Rick

2009-10-04 23:42:10

Smart

Neehosoft

2009-10-04 23:43:49

You have to resize it?

YoHoJo

2009-10-04 23:45:12

The Man, the reason we have to manually click the fixed window button is because SMART cant do anything unless you are on fixed. So this will only work for non-smart scripts.
I mean it will work for smart scripts, but if it works, that means the window is already fixed size anyways.

Also, why does it just wait one second if it doesn't find the DTM shouldn't it just be exit if it cant find it?
Also,
if FindColor(x, y, 2302956, MSX1, MSY1, MSX2, MSY2) then
end;
seems incomplete, if findoclor then WHAT? :D

Rick

2009-10-04 23:45:29

No, the runescape screen has settings so that it can be a fixed size, resizable or full screen.

YoHoJo

2009-10-04 23:55:35

Im lost r!ch!ie, whats your point?
His function makes it so 'resizable window' is disabled.
Which is good, because you can only auto on smart with a fixed size window.
But the reason you can only auto with fixed sized window is because smart cant move mouse/click with resizeable sized window, therefore this procedure wont work/has no need when used with smart. But its fine for non-smart.

Rick

2009-10-04 23:59:07

YoHoJo, I was replying to NeehoSoft :p

From: Neehosoft
You have to resize it?


Gotta love the quick replies at SRL.

JPHamlett

2009-10-05 01:48:52

this will not work at all once you resize it scar will lose focus of the target and the scripts will not run

YoHoJo

2009-10-05 01:54:26

Ah yes, thats another good point, I agree. I think scar will loose focus of the RS window if any resizing is done during run-time of the script, which is why we tell everyone to do it manually before you run the script.

Still great job/effort on the function!

Dynamite

2009-10-05 10:49:00

Wait cant you click at all then?
if you can i made this
function ResizeOff;
var
ResizeDTM : Integer;
begin
if not FindColor(x, y, 2302956, MSX1, MSY1, MSX2, MSY2) then
begin
ResizeDTM:= DTMFromString('78DA63E467606010664001E989E6609A11CA6' +
'76407125CA86A9AAA8350D570000949543596560EA86A4076C9A0' +
'AA3132B240552386698EA6A61EAA1A1120C14FC03D20796E54358' +
'E360A286A009D440703');
Result:= FindDTM(ResizeDTM, X, Y, X1, Y1, X2, Y2);
if not Result then
Wait(1000);
if Result then
Mouse(X, Y, 5, 5, True);
Writeln('Please restart the script');
end;
end;
this will tell the user to restart the script if it has performed the task.

T~M

YoHoJo

2009-10-05 11:14:09

Haha there you go that makes more sense :D.
Yea AFAIK you cant click AT ALL, so making a func to make rs fixed wouldn't work!

mormonman

2009-10-05 12:01:10

Why is it a function if it doesn't use a result?
If you say to restart the script, you might as well terminate it.
If you don't terminate it then you need to free your DTM.

Dynamite

2009-10-05 12:37:16

ok thank you

Gu3st...

2009-10-05 13:16:13

And what is X1 X2 Y1 Y2 X and Y? It seems like they are variables but they're not assigned to Integer or String or anything.. Only variable I see is the DTM

n3ss3s

2009-10-05 20:15:35

People bitching about weird things in The Man's code, by now it should be obvious that he didn't even try to compile it or anything but just whipped it out…

If you don't terminate it then you need to free your DTM.


You have to free the dtms even if you terminate…

mormonman

2009-10-06 00:16:33

From: n3ss3s
People bitching about weird things in The Man's code, by now it should be obvious that he didn't even try to compile it or anything but just whipped it out…



You have to free the dtms even if you terminate…


Really? I thought it killed the thread which free'd them.

Tniffoc

2009-10-06 02:00:56

@mormonman, Ever had a memory leak? That's probably why lol!