Sign in to follow this  
Followers 0
unform25

Sending Fkeys problem

8 posts in this topic

Ok, I've been writing a macro for Eve like so many before me. But I'm having a problem with firing the lasers the way I want them to. Here's what I have so far.

CODE

Func LaseTheRoid()

For $Locked = 1 To 3

WinActivate("E" & $CurrentClient)

WinWaitActive("E" & $CurrentClient)

;click first lock before activating a laser, repeate moving left

MouseClick("LEFT",$WindowSize[0] + $LockedItem[0] - (($Locked - 1) * $LockLaserOffset),$WindowSize[1] + $LockedItem[1])

Sleep(500)

WinActivate("E" & $CurrentClient)

WinWaitActive("E" & $CurrentClient)

;sending the F keys to activate lasers, currently not working

Send("{F "&$Locked&"}")

Next

EndFunc

I'm trying to have the Fkey sent determined by wich loop its on. But all I get is "$" sent and it goes straight to the chat window. I now that I can do this with a long If/ElseIf/Then statement but that would just look like crap to me. The real bugger is that this is the last thing I need to fix before this version is fully functional, so any help you could send my way would be very much appreciated.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

try:

Func LaseTheRoid()
    For $Locked = 1 To 3
WinActivate("E" & $CurrentClient)
WinWaitActive("E" & $CurrentClient)
;click first lock before activating a laser, repeate moving left
    MouseClick("LEFT",$WindowSize[0] + $LockedItem[0] - (($Locked - 1) * $LockLaserOffset),$WindowSize[1] + $LockedItem[1])
    Sleep(500)
WinActivate("E" & $CurrentClient)
WinWaitActive("E" & $CurrentClient)
;sending the F keys to activate lasers, currently not working
Send("{F"&$Locked&"}")

Next
EndFunc
Edited by Gif

Share this post


Link to post
Share on other sites

I'm not seeing the difference between my func and yours.

Share this post


Link to post
Share on other sites

Wait, do you think a single space would be the problem?

Share this post


Link to post
Share on other sites

I can't untill morning when i get off work and go back to my tent. Eve server's blocked here. But I'll post if it worked or not. thanks

Share this post


Link to post
Share on other sites

I can't untill morning when i get off work and go back to my tent. Eve server's blocked here. But I'll post if it worked or not. thanks

i tried:

For $i = 1 To 3
Send("{F"&$i&"}")
next

and it works, the problem is if you use that space it presses the F key multiple times, instead F($i) uses the number of loop to press an Fkey, you can tst it for yourself with my above example....

Share this post


Link to post
Share on other sites

Sweet, ty very much. the bot should work now. now for my next trick i need to figure out how to getpixel while another window is covering it......that's gonna take a while, and probably some more forums searching/asking.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0