• Log in or sign up for an account here: https://www.sythe.org/login

Make the script click buttons like: "Home" and "End"

ToastedApple

Active Member
Joined
Feb 3, 2009
Sythe Gold
65
Messages
147
Hi. I'm using scar for other things than runescape and right now I really have the need to scroll down a page systematically. Is there a way for me to make my script click the: "PgDn" and "End" buttons on my keyboard?

Thanks for your help :)
 
well, the VIRTUAL KEY CODE for this button is :
Code:
VK_NEXT (0x22)
    PAGE DOWN key

so, what we're gonna do is try to implent the virtual key into scar.
well, the msdn uses windows api, and HEX, so what i did was used the delphi virtual key codes:
http://delphi.about.com/od/objectpascalide/l/blvkc.htm

and wel, 0x22 = 22 lol.
so the scar codes look like this :
and scar read's the VK strings so :

Code:
program downpage;
var
i:integer;
const
howlong = 10000; // time in mili seconds so 1 second is 1000;
begin
activateclient;
i := 0;
repeat
if (i < howlong)  then
begin
KeyDown(VK_NEXT);    // VK_NEXT is the downpage button.
wait(1000);
i := i + 1;
end;
until(i = howlong)
end.

would work :):D

~Eduard

wanna learn more? check out my thread
 
You could also do this, and use a procedure with a parameter that allows it to click both, depending on what you need at that particular time. I also added standards to mine, so it's a bit easier to read. Feel free to pm me or post if you need any more help!

Code:
program New;

const
  Pagedown = true;
//True causes the script to fire the procedure PgDnOrEnd(true),
//which in turn fires the key click page down. False does the
//same thing, but for the key click end.

Procedure PgDnOrEnd(PgDn : Boolean);
Begin
  If PgDn = True then
  begin
    KeyDown(VK_Next);
    Wait(50);
    KeyUp(VK_Next);
  end else
  begin
    KeyDown(VK_End);
    Wait(50);
    KeyUp(VK_End);
  end;
end;

begin
  If PageDown then
    PgDnOrEnd(true)
  else
    PgDnOrEnd(false);
end.

~Sandstorm
 
Runescape Gamblingrunescape gambling
Back
Top