SRL Archive - Help

Problems with clicking


Zeaox

2012-07-30 09:34:58

I am not trying to make a script for rs but the game i am trying to make a script for freezes when you click off of that window. I already have the script set up to the best of my nub abilities and it works find except that the screen dosnt unfreeze when i run the script. when i click on the screen to go back to it simba still shows the script as running but it dosnt do any clicking/moving mouse/etc.

riwu

2012-07-30 09:37:06

Did u target the window by dragging the green crosshair (at the top of simba beside the run button) to the window?

Zeaox

2012-07-30 09:37:47

yup

Footy

2012-07-30 09:37:52

I'm confused… What game is this, can you show us the script? Why do you want it to "freeze"?

Zeaox

2012-07-30 09:38:55

Shaiya,do i just copy/paste script in here,and i want to unfreeze not freeze

Footy

2012-07-30 09:40:09

Use activateclient; right after setupSRL to activate your game window, and hopefully unfreeze it. Let me know how it goes.

Zeaox

2012-07-30 09:42:57

program EcFarm;


var
Loads: Integer;


begin
repeat
repeat
MoveMouse (640, 527);
ClickMouse (640, 527, 1);
Wait(4000);
Loads:= Loads+1;
until(Loads >= 150);
MoveMouse (780, 227);
ClickMouse (780, 227, 1);
Wait(1500);
MoveMouse (783, 307)
ClickMouse (783, 307, 1);
Wait(1850);
MoveMouse (780, 389)
ClickMouse (780, 389, 1);
Wait(1495);
until(false);

end.

new to the whole simba thing…whats setupSRL?

Footy

2012-07-30 09:48:28

Nvm, you aren't using SRL functions. But it at the beginning of your main loop, at it should make the screen you dragged your crosshairs to come to the front.

Zeaox

2012-07-30 09:50:39

ok i got it to where it will activate the client but it will still only click that spot when simba is the active window

Footy

2012-07-30 09:52:23

When you chose your co-ords, did you drag your crosshairs to the game before you chose your coords? That could affect it.

Zeaox

2012-07-30 09:53:42

i selected the client then hovered my mouse over where i want it to click then copied the coords

Footy

2012-07-30 09:56:12

Did you use the color picker tool in simba? Try dragging the crosshairs, picking a co-ordinate where your script should be clicking, and compare it with what's in your script.

Zeaox

2012-07-30 09:56:59

k ill try it in a minute im trying to use hotkeys instead of clicks real quick

Footy

2012-07-30 09:58:12

Alright, let me know how it goes.

P1ng

2012-07-30 09:59:11

Give that a whirl..
program EcFarm;

var
Loads: Integer;
begin
ActivateClient;
repeat
repeat
MoveMouse(640, 527);
ClickMouse(640, 527, 1);
Wait(4000);
Loads := Loads + 1;
until (Loads >= 150);
MoveMouse(780, 227);
ClickMouse(780, 227, 1);
Wait(1500);
MoveMouse(783, 307) ClickMouse(783, 307, 1);
Wait(1850);
MoveMouse(780, 389) ClickMouse(780, 389, 1);
Wait(1495);
until (false);
end.

Zeaox

2012-07-30 10:03:14

your code did the same thing it just gets to the point where it activates the window then simba stops doing the other actions and is there a certain way to do keys? because PressKey(<letter>) wasnt working for me

riwu

2012-07-30 10:07:46

From: Zeaox
your code did the same thing it just gets to the point where it activates the window then simba stops doing the other actions and is there a certain way to do keys? because PressKey(<letter>) wasnt working for me

What parameter are u keying in for Presskey? You need to do VK_F1 (srl constant) for example if you want to press F1. You can take a look at http://docs.villavu.com/simba/scriptref/mouseandkeyboard.html for keyboard functions.

Zeaox

2012-07-30 10:15:52

i was trying to use R for the letter i got the number for it off the list on that link but it types 4 instead of R

Zeaox

2012-07-30 10:24:38

is there something with simba that it wont work when its not the active window?

P1ng

2012-07-30 10:29:17

Simba should work fine when the client is activated, and the VK code for R is 82 so PressKey(82) will work. Trial and error lead me to that number, tested it and it worked.

Zeaox

2012-07-30 10:32:49

yeah still dosnt work unless simba is the active window must be some problem with the interaction between the two

P1ng

2012-07-30 10:39:11

What game is it you are trying to play, and how do you mean it doesn't work? The mouse isn't moving or?

I added a couple of other little bits and pieces to it with comments to show you what it's doing and why I put it there. Tested it out and it moved the mouse around and clicked on random stuff (on my notepad, given I don't know what game it's for I used a full-screen notepad as the client).
program EcFarm;

var
Loads: Integer;

begin
ActivateClient; // Makes defined client active window
repeat
Loads := 0; // It will keep increasing loads but never reset it without this
repeat
Status('Loads: ' + IntToStr(Loads)); // Writes what loads equals in the status bar
MoveMouse(640, 527);
ClickMouse(640, 527, 1);
Wait(4000);
Inc(Loads); // Same as Loads := Loads + 1; but neater
until (Loads >= 150);
MoveMouse(780, 227);
ClickMouse(780, 227, 1);
Wait(1500);
MoveMouse(783, 307);
ClickMouse(783, 307, 1);
Wait(1850);
MoveMouse(780, 389);
ClickMouse(780, 389, 1);
Wait(1495);
until (false);
end.

Zeaox

2012-07-30 10:44:30

a game called shaiya im trying to make a simple auto kill and when i say it dosnt work if i activate the client then simba stops clicking or doing any other actions it still says the script is running and if i click back to simba it will type/click where and when i want it to but then the game freezes up because it isnt the active window

P1ng

2012-07-30 11:30:55

You're using the crosshair to define your game as the client before running it?

Zeaox

2012-07-30 11:36:26

yeah