Can u please help me edit this script?i want to Suspend this script unless those 2 conditions meet

Ask gaming related questions
Nourhan2105
Posts: 2
Joined: 05 Jan 2021, 00:19

Can u please help me edit this script?i want to Suspend this script unless those 2 conditions meet

Post by Nourhan2105 » 24 Jan 2021, 08:20

This code only works if mouse is not shown, i want to modify it so that it will only work if mouse in not shown + holding the Right mouse button,, can anyone please help me with that i have been searching alot but with no luck unfortunately... Thanks in advance

Here is the code :

Code: Select all

#NoEnv
SendMode Input
 
IniRead, Key1, Settings.ini, Settings, SuspendKey, Insert
IniWrite, %Key1%, Settings.ini, Settings, SuspendKey
Hotkey, %Key1%, ~$hkWrite
 
Gui Color, 0x000000
Gui Font, c0xB4BD02
TrayTip, Entity PUBX64Build, Now Running in the Background!, 2
Gui, Add, Text, x80 y75 w75 h20 +0x200 +center, Suspend:
Gui, Add, ComboBox, x80 y95 w120 vSuspend, Insert||XButton1|Delete|F1|F2|F3|F4|F5|TAB
Gui Add, ComboBox, x80 y40 w120 vRCT, 1.2||1|2|3|4|5|6|7
Gui, Add, Button, gSaveVal x80 y120, Save
Gui, Add, Button, gLoadVal x130 y120, Load
Gui Add, Text, x80 y16 w95 h23 +0x200 +center, Recoil Timing: 
Gui Show, w300 h150, Entity PUBX64 V1.0 (ALPHA)
 isMouseShown()
{
   StructSize := A_PtrSize + 16
   VarSetCapacity(InfoStruct, StructSize)
   NumPut(StructSize, InfoStruct)
   DllCall("GetCursorInfo", UInt, &InfoStruct)
   Result := NumGet(InfoStruct, 8)

   if Result > 1
      return 1
   else
      return 0
}

Loop
{
   if isMouseShown() == 1
      Suspend On
   else
      Suspend Off

   Sleep 500
}
~*$LButton::
Loop
{
GetKeyState, state, LButton, P
if state=u
break
Gui, Submit, nohide
mouseXY(0,RCT)
sleep, 5
}
return
 
mouseXY(x,y)
{
DllCall("mouse_event",int,1,int,x,int,y,uint,0,uint,0)
}
 
~$hkWrite:
Suspend, Permit
Suspend, Toggle
return
 
SaveVal:
IniDelete, Settings.ini, NoRecoil, RecoilTiming
IniRead, SaveVal1, Settings.ini, NoRecoil, RecoilTiming, %RCT%
IniWrite, %SaveVal1%, Settings.ini, NoRecoil, RecoilTiming
MsgBox, Saved Config
goSub ~$hkWrite
return
 
LoadVal:
IniRead, ReadVal1, Settings.ini, NoRecoil, RecoilTiming
IniWrite, %ReadVal1%, Settings.ini, NoRecoil, RecoilTiming
GuiControl, choosestring, RCT, %ReadVal1%
MsgBox, Loaded Config
goSub ~$hkWrite
return
 


GuiEscape:
GuiClose:
    ExitApp
[Mod edit: [code][/code] tags added.]
User avatar
mikeyww
Posts: 5142
Joined: 09 Sep 2014, 18:38

Re: Can u please help me edit this script?i want to Suspend this script unless those 2 conditions meet

Post by mikeyww » 24 Jan 2021, 09:03

You can remove the "if isMouseShown() == 1" loop and just put this directive before your hotkey list.

Code: Select all

#If !isMouseShown() && GetKeyState("RButton", "P")
Nourhan2105
Posts: 2
Joined: 05 Jan 2021, 00:19

Re: Can u please help me edit this script?i want to Suspend this script unless those 2 conditions meet

Post by Nourhan2105 » 24 Jan 2021, 09:15

@mikeyww
Omg thank you it really works <3
Post Reply

Return to “Gaming”