Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Send changed variables to already running function without pausing macro? Solved
#11
had an extra command in PlayerHelper. now fixed.

After looking at this further you can simplified this alot.
since action is the same in CombatSettings and the only thing that is different is the image that is being scanned for
simpler to just pass resource from PlayerHelper to CombatSettings and scan.

Macro PlayerHelper
Code:
Copy      Help
__RegisterHotKey hk1.Register(0 1 MOD_CONTROL|MOD_SHIFT 'X')
__RegisterHotKey hk2.Register(0 2 MOD_CONTROL|MOD_SHIFT 'Y')
__RegisterHotKey hk3.Register(0 3 MOD_CONTROL|MOD_SHIFT 'C')
__RegisterHotKey hk4.Register(0 4 MOD_CONTROL|MOD_SHIFT VK_F10)

int x;; Kampfsperre
int y;; Zuschauverbot
int c;; Taktikmodus
int hthread1 hthread2 hthread3
MSG z
rep
,if(GetMessage(&z 0 0 0)<1) break
,sel z.message
,,case WM_HOTKEY
,,sel z.wParam
,,,case 1
,,,,x = !x
,,,,if (x)
,,,,,OnScreenDisplay "Kampfsperre" -1 20 100 "Arial" 20 0x00FFFF 8 "1"
,,,,,hthread1=mac("CombatSettings" "" "resource:Kampfmodus_Sperren.bmp")
,,,,else
,,,,,OsdHide "1"
,,,,,shutdown -6 0 "CombatSettings" hthread1
,,,case 2
,,,,y = !y
,,,,if (y)
,,,,,OnScreenDisplay "Zuschauverbot" -1 20 140 "Arial" 20 0x00FFFF 8 "2"
,,,,,,hthread2=mac("CombatSettings" "" "resource:Kampfmodus_zuschauer.bmp")
,,,,else
,,,,,OsdHide "2"
,,,,,shutdown -6 0 "CombatSettings" hthread2
,,,case 3
,,,,c = !c
,,,,if (c)
,,,,,OnScreenDisplay "Taktikmodus" -1 20 180 "Arial" 20 0x00FFFF 8 "3"
,,,,,hthread3=mac("CombatSettings" "" "resource:Kampfmodus_map.bmp")
,,,,else
,,,,,OsdHide "3"
,,,,,shutdown -6 0 "CombatSettings" hthread3
,,,case 4
,,,if(x=0 and y=0 and c=0);; end macro only if x  y and c are zero
,,,,OnScreenDisplay "END" 3 50 400 "Arial" 20 0x00FFFF
,,,,ret;; end macro
,DispatchMessage &z

 and here is new CombatSettings function
Function CombatSettings
Code:
Copy      Help
function ~resource
rep
,if(scan(resource 0 0 1|16 30))
,,wait 0.5
,,lef


Messages In This Thread
RE: Send changed variables to already running function without pausing macro? Solved - by Kevin - 08-06-2020, 07:42 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)