I appreciate any help given on helping me figure this one out as I'm rather stumped.
I'm having difficulties getting a script to intercept a mouse click so that I can choose to either accept, deny or modify it based on the location of the cursor on the screen (if it is over the minimap in League of Legends).
I have tried remapping the mouse button to null and using the Hotkey On/Off command to toggle its activation state depending on the cursor location but for some reason I cannot seem to get it to work. I feel quite certain that this is what I need to do but I feel like perhaps my lack of understanding the structure of script programming properly is what is preventing me from getting it working - I'm not a programmer and just read the help files, google for insight or trial and error to sometimes get things working. It's beginning to frustrate me a little.
I wouldsend through my latest attempt using the Hotkey function, but unfortunately, after countless iterations, various strategies and around 12 hours (yes, I swear, it's quite embarrassing) it turns out I don't have a save using that particular strategy. I will try and work one up when I have the time. In the meantime, I'm posting this up on the forums to see if I can get a head start.
The basic gist of what I have/will have (rough draft with truncations for simplicity):
Sorry about the lack of code formatting, I know it's dreadful to try and read like this. I CAN'T EVEN GET BBS INDENTATION CODES TO WORK!! no wonder I have so much trouble programming.#Ifwinactive LoL.exe
Hotkey, RButton, RButtonHotkey, Off ;- Initializes the RButton Hotkey and sets it to off
SetTimer, LeagueCheck, 1000
;- -- MAIN LOOP --
LeagueCheck:
while WinActive("LoL.exe") { ;- periodically checks if LoL.exe is the active window before proceeding
;~ OFFMAP STUFF
Loop {
MouseGetPos, Xpos, Ypos
OnMap := ((Xpos > MapX) AND (Ypos > MapY))
} Until OnMap ;~ loops mouse position check until it is over the map, ie. OnMap = True
Hotkey, RButton, On
;~ ONMAP STUFF
Loop {
MouseGetPos, Xpos, Ypos
...
} Until (Xpos < MapX) OR (Ypos < MapY) ;~ loops until cursor is off the map, then turns the Hotkey Off and sets OnMap = False
Hotkey, Rbutton, Off
OnMap := !OnMap
}
return
RButtonHotkey: ;- the Hotkey label/function
RButton::
return
Anyways, any help would be great thank you.
Danniique