Question for programmers.

03/04/2008 10:27 Stink.Fly#1
Im trying to make an auto pooter/sitter/mp program in visual basic and i have this so far:

Code:
SendKeys ("{" & cblMP.Text & "}")
cblMP is a combo list box with hotkeys f1-f10 listed in it so people can choose which one they want.

Its not working though.... if i use:

Code:
SendKeys ("{F1}")
It works fine.... cant figure out why so if someone could help me out id like that.

OH, and also if someone can show me how to send it to the Conquer Client only, not just every foremost window... :) thanks
03/04/2008 12:32 leavemealone#2
Try this instead:
Code:
SendKeys ("{" + cblMP.Text + "}")
Not sure one hundred percent but in C# we use + not & not sure if VB is same.
03/04/2008 13:11 Stink.Fly#3
Quote:
Originally Posted by leavemealone View Post
Try this instead:
Code:
SendKeys ("{" + cblMP.Text + "}")
Not sure one hundred percent but in C# we use + not & not sure if VB is same.

Nah its still not working. i think im gonna have to just use preset keys

Meh, couldn't figure it out so i settled. Just uploaded it so if someone cud scan it and approve itd be cool.
03/04/2008 14:19 Stink.Fly#4
Gonna try and keep all my questions in one thread so dont flame me for posting twice please.

Anyone know how i would go about reading things like virtue points and level and stuff from the memory? ive seen it done before but cant figure it out. like leavemealone's thing and *m*s tthing. both seem to read from the ram but i dont know how theyve done it. thanks in advance
03/04/2008 14:37 evanxxxm#5
Stink.Fly@
do a click at the spot x110 u 760
send F keys do not work on AutoHotKey language also
besides, clicking is better than sending Fs, because it can be background/minimized mode
03/04/2008 14:50 Stink.Fly#6
Quote:
Originally Posted by evanxxxm View Post
Stink.Fly@
do a click at the spot x110 u 760
send F keys do not work on AutoHotKey language also
besides, clicking is better than sending Fs, because it can be background/minimized mode
Where does X110, Y760 click then? I wanted to avoid co-ordinates cuz i think they change if people are running various definitions or window sizes dont they?

AutoHotKey looks like something fun to play with, might have to experiment.
03/04/2008 16:23 evanxxxm#7
x110, y760 is exactly the spot for F1 in CO

[Only registered and activated users can see links. Click Here To Register...]

window size, position of CO does not matter if the clicking position is declare on a program

so for example, in ahk code it will be
Code:
[B]WinGet,id, ID,[Conquer2.0][/B]
[COLOR="DimGray"][I];declare [Conquer2.0] as id[/I][/COLOR]
[B]ControlClick, x110 y760,ahk_id %id%,,RIGHT[/B]
[COLOR="DimGray"][I];controlclick the position on "id"[/I][/COLOR]


the above code works in minimized client, it will controlclick at the position of F1
03/04/2008 16:42 Stink.Fly#8
Quote:
Originally Posted by evanxxxm View Post
x110, y760 is exactly the spot for F1 in CO

[Only registered and activated users can see links. Click Here To Register...]

window size, position of CO does not matter if the clicking position is declare on a program

so for example, in ahk code it will be
Code:
[B]WinGet,id, ID,[Conquer2.0][/B]
[COLOR=dimgray][I];declare [Conquer2.0] as id[/I][/COLOR]
[B]ControlClick, x110 y760,ahk_id %id%,,RIGHT[/B]
[COLOR=dimgray][I];controlclick the position on "id"[/I][/COLOR]
the above code works in minimized client, it will controlclick at the position of F1
Ahhh, i getcha. Thanks.
03/04/2008 18:03 bone-you#9
The window size should matter. 800x600 has a different x,y location for F1 than 1024x768.
03/04/2008 19:23 evanxxxm#10
in ahk, there is also a check window size to fix it
combine with the above codes, it will be:
Code:
[B]WinGetPos, XX, YY, Width, Height, [Conquer2.0]  [/B]
[I];output the position of CO, and the size of CO. which we only need to focus on Height in this case[/I]
[B]Height -= 10[/B]
[I];mins 10pixel in order to click a center spot in the Fslots[/I][B]
WinGet,id, ID,[Conquer2.0]
ControlClick, x110 y%Height%,ahk_id %id%,,RIGHT[/B]
[I];click x110, and Height, which is either 590 or 758[/I]
well usually i have 800x600 and 1024x768 version for my programs, so i never really need to use check window size...anyways, its just an idea
thanks for pointing out the error
03/04/2008 20:53 Stink.Fly#11
Quote:
Originally Posted by bone-you View Post
The window size should matter. 800x600 has a different x,y location for F1 than 1024x768.
Which was meant to be my original theory lol suppose i could do two versions of each if i send mouse events to co-ords
03/06/2008 08:43 Ulfius#12
First, I would set a break point on the following line to inspect what cblMP.Text is when it executes.

SendKeys ("{" & cblMP.Text & "}")

If that doesn't lead you to a solution, then try something like:

Select Case cblMP.Text
Case "F1"
SendKeys ("{F1}")
Case "F2"
SendKeys ("{F2}")
...
Case "F12"
SendKeys ("{F12}")

End Select
03/06/2008 09:58 Stink.Fly#13
Quote:
Originally Posted by Ulfius View Post
First, I would set a break point on the following line to inspect what cblMP.Text is when it executes.

SendKeys ("{" & cblMP.Text & "}")

If that doesn't lead you to a solution, then try something like:

Select Case cblMP.Text
Case "F1"
SendKeys ("{F1}")
Case "F2"
SendKeys ("{F2}")
...
Case "F12"
SendKeys ("{F12}")

End Select
:rolleyes: good idea... damn lol. Wanted to avoid the select case argument though :(