Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Send changed variables to already running function without pausing macro? Solved
#2
I don't know what you are trying to do, but your code has some flaws, try this one instead. This macro combines your "CombatSettings" function inside too:

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=0 ;; Kampfsperre
int y=0 ;; Zuschauverbot
int c=0 ;; Taktikmodus

MSG z
rep
,if(GetMessage(&z 0 0 0)<1) break
,sel z.message
,,case WM_HOTKEY
,,sel z.wParam
,,,case 1
,,,x += 1
,,,if (x=1)
,,,,OnScreenDisplay "Kampfsperre" -1 20 100 "Arial" 20 0x00FFFF 8 "1"
,,,,sub.CombatSettings x y c
,,,else
,,,,x=0
,,,,OsdHide "1"
,,,;end function
,,,,
,,,case 2
,,,y +=1
,,,if (y=1)
,,,,OnScreenDisplay "Zuschauverbot" -1 20 140 "Arial" 20 0x00FFFF 8 "2"
,,,,sub.CombatSettings x y c
,,,else
,,,,y = 0
,,,,OsdHide "2"
,,,;end function
,,,,
,,,case 3
,,,c += 1
,,,if (c=1)
,,,,OnScreenDisplay "Taktikmodus" -1 20 180 "Arial" 20 0x00FFFF 8 "3"
,,,,sub.CombatSettings x y c
,,,else
,,,,c = 0
,,,,OsdHide "3"
,,,;end function
,,,,
,,,case 4
,,,,OnScreenDisplay "END" 3 50 400 "Arial" 20 0x00FFFF

,,,ret
,DispatchMessage &z

#sub CombatSettings
function x1 y1 c1

;out F"X1={x1}, Y1={y1}, C1={c1}"

if (x1=1)
,if (scan("resource:Kampfmodus_Sperren.bmp" 0 0 1|16 30))
,,wait 0.5
,,lef
,
if (y1=1)
,if (scan("resource:Kampfmodus_zuschauer.bmp" 0 0 1|16 30))
,,wait 0.5
,,lef
,
if (c1=1)
,if (scan("resource:Kampfmodus_map.bmp" 0 0 1|16 30))
,,wait 0.5
,,lef


Messages In This Thread
RE: How to send changed variables to already running function without pausing macro? - by TeddyBear - 08-05-2020, 04:25 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)