This isn't the code I last gave you btw,
It's true, but as it is simpler and I notice the main problem is not the lag i used this. If I can solve It, I will return to the last codes you did, were working but I have this same problem.
It may be that the mouse move filter isn't actually needed (as I think you said after I asked you to isolate what was happening, that the gun shot went to wherever the mouse was without scripts running)
I do need filter mous_move, because guns are always tracking, so I need to block them and only unblock the one wich shot, else shots gets crossed between them indistinctly.
I also would need to take the coordinates on when the flash is running, else the gun shoots and the screen is dark, and an offscreen shoot gets returned.
It's not easy to explain...
maybe something like this? simulating a mousebutton4 click "0x040" when the flash is launched and wait for it "if (state = 0x040)", would force to get coordinates in that moment?
Code: Select all
else if is_mouse(device)
{
get_keyname(mouse,name,state)
if (device = gun1id || device = gun2id)
{
;if name=LButton
;{
if (state = 1)
{
if (device = gun1id)
flasher := gun1flasher
if (device = gun2id)
flasher := gun2flasher
send %flasher%
sleep, %triggerdelay%
mouse.state := 0x040
send(context,device,mouse,1)
}
if (state = 0x040)
{
mouse.state := 1
send(context,device,mouse,1)
sleep, %triggerlength%
mouse.state := 2
send(context,device,mouse,1)
}
;else (NOT NEEDED, ELSE MOVEMENT GETS UNLOCKED)
;send(context,device,mouse,1)
;}
}
}
I'll try this night and share results.
thanks for the help!