Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global up := "up"
- global down := "down"
- global left := "left"
- global right := "right"
- global start := "1"
- global LP := "a"
- global MP := "s"
- global HP := "d"
- global LK := "z"
- global MK := "x"
- global HK := "c"
- global helpers
- helpers=
- (
- Collosus,LP MP MK
- PsyLock,MK
- Sentinel,MP MK HP
- Shadow Charlie, LP MK HP
- )
- helper_list=
- loop parse, helpers, `n,`r
- {
- if not a_loopfield
- continue
- loop parse, a_loopfield, `,
- {
- if a_index = 1
- {
- helper_list=%helper_list%%a_loopfield%|
- }
- else
- break
- }
- }
- stringreplace helper_list, helper_list,`n,|,a
- stringreplace helper_list, helper_list,Collosus|,Collosus|| ; make collosus selected by default
- gui, font, s13
- gui, font, bold
- gui, add, text, xm y+20 w80 , CHARACTERS:
- gui, font, norm
- gui, add, text,y+1,F12: Shadow Lady`nF11: Red Venom`nF10: Gold War Machine`nF9: Lilith`nF8: Orange Hulk`nF7: Roll
- gui, font, bold
- gui, add, text, xm y+20 w80 , ASSISTS (HOLD):
- gui, font, norm
- gui, add, text,y+1,F6: Helper
- gui, font, s10
- gui, add, dropdownlist, x+5 vHelperDDL w100, %helper_list%
- ;`nF5: Sentinel`nF4: Shadow
- /*
- Gui, Font, S12 CDefault, Calibri
- Gui, Add, GroupBox, x6 y-3 w250 h350 , Hotkeys
- Gui, Add, Text, x16 y27 w120 h20 , Red Venom
- Gui, Add, Edit, x106 y27 w140 h30 , Edit
- Gui, Add, Text, x16 y67 w120 h20 , Gold WM
- Gui, Add, Edit, x106 y67 w140 h30 , Edit
- Gui, Add, Text, x16 y107 w120 h20 , Shadow Lady
- Gui, Add, Text, x16 y147 w120 h20 , Lilith
- Gui, Add, Text, x16 y187 w120 h20 , Orange Hulk
- Gui, Add, Text, x16 y227 w120 h20 , Roll
- Gui, Add, Text, x16 y267 w120 h20 , Random
- Gui, Add, Edit, x106 y107 w140 h30 , Edit
- Gui, Add, Edit, x106 y147 w140 h30 , Edit
- Gui, Add, Edit, x106 y187 w140 h30 , Edit
- Gui, Add, Edit, x106 y227 w140 h30 , Edit
- Gui, Add, Edit, x106 y267 w140 h30 , Edit
- Gui, Add, Button, x266 y247 w200 h100 +, Save
- Gui, Add, Button, x86 y307 w80 h30 , Default
- Gui, Add, Text, x276 y27 w40 h20 , Up
- Gui, Add, Edit, x316 y27 w140 h30 , Edit
- Gui, Add, Text, x276 y67 w60 h20 , Down
- Gui, Add, Edit, x316 y67 w140 h30 , Edit
- Gui, Add, Text, x276 y107 w40 h20 , Left
- Gui, Add, Edit, x316 y107 w140 h30 , Edit
- Gui, Add, Text, x276 y147 w40 h20 , Right
- Gui, Add, Edit, x316 y147 w140 h30 , Edit
- Gui, Add, GroupBox, x266 y-3 w200 h240 , Inputs
- Gui, Add, Button, x326 y187 h358 w477 w80 h30 , Default
- ; Generated using SmartGUI Creator 4.0
- ;Gui, Show, New GUI Window
- */
- gui, show,, MvC HELPER
- return
- #ifwinnotactive NoteWorthy Composer
- !x::
- {
- exitsleep = Yes
- return
- }
- f6::
- /*
- MARVEL VS. CAPCOM REFERENCE LAYOUT
- LP=A MP=S HP=D
- LK=Z MK=X HK=C
- start=1
- lp=A
- mp=S
- mk=X
- tooltip COLLOSUS ACTIVATED
- sleep 5
- send {%start% down}
- send {%lp% down}
- send {%mp% down}
- send {%mk% down}
- keywait F6,Up
- sleep 5
- send {%start% up}
- send {%lp% up}
- send {%mp% up}
- send {%mk% up}
- tooltip
- return
- */
- guicontrolget, helperDDL
- correct_code=
- loop parse, helpers, `n,`r
- {
- if not a_loopfield
- continue
- name=
- code=
- loop parse, A_Loopfield, csv
- {
- if a_index = 1
- name = %a_loopfield%
- else if a_index = 2
- code = %a_loopfield%
- }
- if (name = helperDDL)
- {
- correct_code = %code%
- break
- }
- }
- if not correct_code
- correct_code := "LP MP MK"
- button1=
- button2=
- button3=
- correct_code = %correct_code% ;trim white space
- loop parse, correct_code, %a_space%
- {
- if a_index = 1
- button1 = %a_loopfield%
- if a_index = 2
- button2 = %a_loopfield%
- if a_index = 3
- button3 = %a_loopfield%
- }
- if button1
- button1 := %button1% ; "convert LP to a, etc."
- if button2
- button2 := %button2%
- if button3
- button3 := %button3%
- tooltip %HelperDDL% Activated
- sleep 5
- send {%start% down}
- if button1
- send {%button1% down}
- if button2
- send {%button2% down}
- if button3
- send {%button3% down}
- keywait F6,Up
- sleep 5
- send {%start% up}
- if button1
- send {%button1% up}
- if button2
- send {%button2% up}
- if button3
- send {%button3% up}
- tooltip
- return
- f5::
- start=1
- mp=S
- hp=D
- mk=X
- tooltip SENTINEL ACTIVATED
- sleep 5
- send {%start% down}
- send {%mp% down}
- send {%hp% down}
- send {%mk% down}
- keywait F5,Up
- sleep 5
- send {%start% up}
- send {%mp% up}
- send {%hp% up}
- send {%mk% up}
- tooltip
- return
- f4::
- start=1
- lp=A
- hp=D
- mk=X
- tooltip SHADOW ACTIVATED
- sleep 5
- send {%start% down}
- send {%lp% down}
- send {%hp% down}
- send {%mk% down}
- keywait F4,Up
- sleep 5
- send {%start% up}
- send {%lp% up}
- send {%hp% up}
- send {%mk% up}
- tooltip
- return
- f7::
- {
- PickRoll()
- return
- }
- f8::
- {
- PickOrangeHulk()
- return
- }
- f9::
- {
- PickLilith()
- return
- }
- f10::
- {
- PickGoldWM()
- return
- }
- f11::
- {
- PickRedVenom()
- return
- }
- f12::
- {
- PickShadowLady()
- return
- }
- PickRoll()
- {
- code := "Right, Left, Left, Down, Down, Right, Right, Down, Down, Left, Left, Up, Right, Up, Up, Right, Right"
- loop parse, code, `,,%a_space%
- {
- move(%a_loopfield%)
- }
- return
- }
- PickOrangeHulk()
- {
- code := "Left, Right, Right, Down, Down, Left, Left, Right, Right, Down, Down, Left, Left, Up, Up, Up, Up, Down, Down, Right, Right, Up, Up, Down, Down, Down, Down, Up, Up, Up, Up, Left, Up"
- loop parse, code, `,,%a_space%
- {
- move(%a_loopfield%)
- }
- return
- }
- PickLilith()
- {
- code := "Right, Left, Left, Down, Down, Right, Right, Up, Up, Down, Down, Down, Down, Left, Left, Up, Up, Up, Up, Right, Left, Down, Down, Down, Down, Right, Right, Up, Up, Up, Up, Left, left, Down, Down, Down, Down, Right, Down"
- loop parse, code, `,,%a_space%
- {
- move(%a_loopfield%)
- }
- return
- }
- PickGoldWm()
- {
- code := "Right, Left, Left, Down, Down, Right, Right, Down, Down, Left, Left, Up, Up, Up, Up, Right, Right, Left, Left, Down, Down, Down, Down, Right, Right, Up, Up, Left, Left, Down, Down, Right, Right, Up, Up, Up, Up, Up"
- loop parse, code, `,,%a_space%
- {
- move(%a_loopfield%)
- }
- return
- }
- PickRedVenom()
- {
- code := "Left, Right, Down, Down, Down, Down, Left, Up, Up, Up, Up, Right, Right, Down, Down, Left, Left, Down, Down, Right, Right, Up, Up, Up, Up, Left, Left, Up"
- loop parse, code, `,,%a_space%
- {
- move(%a_loopfield%)
- }
- return
- }
- PickShadowLady()
- {
- move(up)
- move(right)
- move(right)
- move(down)
- move(down)
- move(down)
- move(down)
- move(left)
- move(left)
- move(up)
- move(up)
- move(up)
- move(up)
- move(right)
- move(right)
- move(left)
- move(left)
- move(down)
- move(down)
- move(right)
- move(right)
- move(down)
- move(down)
- move(left)
- move(left)
- move(up)
- move(up)
- move(right)
- move(right)
- move(up)
- move(up)
- move(left)
- move(left)
- move(down)
- move(down)
- move(down)
- move(down)
- move(down)
- return
- }
- Move(direction)
- {
- delay = 5
- sleep 5
- if (direction = "up")
- {
- send {Up down}
- sleep %delay%
- send {Up up}
- }
- else if (direction = "down")
- {
- send {down down}
- sleep %delay%
- send {Down up}
- }
- else if (direction = "left")
- {
- send {Left down}
- sleep %delay%
- send {Left up}
- }
- else if (direction = "right")
- {
- send {Right down}
- sleep %delay%
- send {Right up}
- }
- return
- }
- !c::
- {
- WinTitle = Edit cheat settings
- ControlName = SysListView321
- IfWinExist %WinTitle%
- {
- }
- else
- {
- msgbox window not found
- return
- }
- LVSel(WinTitle, ControlName, 1)
- Control, Choose, 2, ComboBox1, %WinTitle%
- LVSel(WinTitle, ControlName, 2)
- Control, Choose, 2, ComboBox1, %WinTitle%
- ;LVSel(WinTitle, ControlName, 3)
- ;Control, Choose, 4, ComboBox1, %WinTitle%
- LVSel(WinTitle, ControlName, 10)
- Control, Choose, 2, ComboBox1, %WinTitle%
- LVSel(WinTitle, ControlName, 11)
- Control, Choose, 2, ComboBox1, %WinTitle%
- LVSel(WinTitle, ControlName, 12)
- Control, Choose, 2, ComboBox1, %WinTitle%
- LVSel(WinTitle, ControlName, 42)
- Control, Choose, 2, ComboBox1, %WinTitle%
- LVSel(WinTitle, ControlName, 44)
- Control, Choose, 2, ComboBox1, %WinTitle%
- return
- }
- LVSel(WinTitle,NNListview,r=1)
- {
- r-=1
- LVIS_FOCUSED:=1
- LVIS_SELECTED:=2
- LVM_SETITEMSTATE:=0x102B
- VarSetCapacity(LVITEM, 20, 0) ;to receive LVITEM
- NumPut(LVIS_FOCUSED | LVIS_SELECTED, LVITEM, 12) ; state
- NumPut(LVIS_FOCUSED | LVIS_SELECTED, LVITEM, 16) ; stateMask
- RemoteBuf_Open(hLVITEM, WinExist(WinTitle), 20) ; MASTER_ID = the ahk_id of the process owning the SysListView32 control
- RemoteBuf_Write(hLVITEM, LVITEM,20)
- SendMessage,LVM_SETITEMSTATE,r,RemoteBuf_Get(hLVITEM),%NNListview%,%WinTitle% ; supposing the cntrlNN is SysListView321
- RemoteBuf_Close(hLVITEM)
- }
- ; Title: Remote Buffer
- ; *Read and write process memory*
- ;
- /*-------------------------------------------------------------------------------
- Function: Open
- Open remote buffer
- Parameters:
- H - Reference to variable to receive remote buffer handle
- hwnd - HWND of the window that belongs to the process
- size - Size of the buffer
- Returns:
- Error message on failure
- */
- RemoteBuf_Open(ByRef H, hwnd, size) {
- static MEM_COMMIT:=0x1000, PAGE_READWRITE:=4
- WinGet, pid, PID, ahk_id %hwnd%
- hProc := DllCall( "OpenProcess", "uint", 0x38, "int", 0, "uint", pid) ;0x38 = PROCESS_VM_OPERATION | PROCESS_VM_READ | PROCESS_VM_WRITE
- IfEqual, hProc,0, return A_ThisFunc "> Unable to open process (" A_LastError ")"
- bufAdr := DllCall( "VirtualAllocEx", "PTR", hProc, "PTR", 0, "PTR", size, "uint", MEM_COMMIT, "uint", PAGE_READWRITE)
- IfEqual, bufAdr,0, return A_ThisFunc "> Unable to allocate memory (" A_LastError ")"
- ; Buffer handle structure:
- ; @0: hProc
- ; @4: size
- ; @8: bufAdr
- VarSetCapacity(H, A_PtrSize*3, 0 )
- NumPut( hProc, H, 0,"PTR")
- NumPut( size, H, A_PtrSize,"PTR")
- NumPut( bufAdr, H, A_PtrSize*2,"PTR")
- }
- /*----------------------------------------------------
- Function: Close
- Close the remote buffer
- Parameters:
- H - Remote buffer handle
- */
- RemoteBuf_Close(ByRef H) {
- static MEM_RELEASE := 0x8000
- handle := NumGet(H, 0,"PTR")
- IfEqual, handle, 0, return A_ThisFunc "> Invalid remote buffer handle"
- adr := NumGet(H, A_PtrSize*2,"PTR")
- r := DllCall( "VirtualFreeEx", "PTR", handle, "PTR", adr, "PTR", 0, "uint", MEM_RELEASE)
- ifEqual, r, 0, return A_ThisFunc "> Unable to free memory (" A_LastError ")"
- DllCall( "CloseHandle", "PTR", handle )
- VarSetCapacity(H, 0 )
- }
- /*----------------------------------------------------
- Function: Read
- Read from the remote buffer into local buffer
- Parameters:
- H - Remote buffer handle
- pLocal - Reference to the local buffer
- pSize - Size of the local buffer
- pOffset - Optional reading offset, by default 0
- Returns:
- TRUE on success or FALSE on failure. ErrorMessage on bad remote buffer handle
- */
- RemoteBuf_Read(ByRef H, ByRef pLocal, pSize, pOffset := 0){
- handle := NumGet( H, 0,"PTR"), size:= NumGet( H, A_PtrSize,"PTR"), adr := NumGet( H, A_PtrSize*2,"PTR")
- IfEqual, handle, 0, return A_ThisFunc "> Invalid remote buffer handle"
- IfGreaterOrEqual, offset, %size%, return A_ThisFunc "> Offset is bigger then size"
- VarSetCapacity( pLocal, pSize )
- return DllCall( "ReadProcessMemory", "PTR", handle, "PTR", adr + pOffset, "PTR", &pLocal, "PTR", size, "PTR", 0 ), VarSetCapacity(pLocal, -1)
- }
- /*----------------------------------------------------
- Function: Write
- Write local buffer into remote buffer
- Parameters:
- H - Remote buffer handle
- pLocal - Reference to the local buffer
- pSize - Size of the local buffer
- pOffset - Optional writting offset, by default 0
- Returns:
- TRUE on success or FALSE on failure. ErrorMessage on bad remote buffer handle
- */
- RemoteBuf_Write(Byref H, byref pLocal, pSize, pOffset:=0) {
- handle:= NumGet( H, 0,"PTR"), size := NumGet( H, A_PtrSize,"PTR"), adr := NumGet( H, A_PtrSize*2,"PTR")
- IfEqual, handle, 0, return A_ThisFunc "> Invalid remote buffer handle"
- IfGreaterOrEqual, offset, %size%, return A_ThisFunc "> Offset is bigger then size"
- return DllCall( "WriteProcessMemory", "PTR", handle,"PTR", adr + pOffset,"PTR", &pLocal,"PTR", pSize, "PTR", 0 )
- }
- /*----------------------------------------------------
- Function: Get
- Get address or size of the remote buffer
- Parameters:
- H - Remote buffer handle
- pQ - Query parameter: set to "adr" to get address (default), to "size" to get the size or to "handle" to get Windows API handle of the remote buffer.
- Returns:
- Address or size of the remote buffer
- */
- RemoteBuf_Get(ByRef H, pQ:="adr") {
- return pQ = "adr" ? NumGet(H, A_PtrSize*2,"PTR") : pQ = "size" ? NumGet(H, A_PtrSize,"PTR") : NumGet(H,"PTR")
- }
- /*---------------------------------------------------------------------------------------
- Group: Example
- (start code)
- ;get the handle of the Explorer window
- WinGet, hw, ID, ahk_class ExploreWClass
- ;open two buffers
- RemoteBuf_Open( hBuf1, hw, 128 )
- RemoteBuf_Open( hBuf2, hw, 16 )
- ;write something
- str := "1234"
- RemoteBuf_Write( hBuf1, str, strlen(str) )
- str := "_5678"
- RemoteBuf_Write( hBuf1, str, strlen(str), 4)
- str := "_testing"
- RemoteBuf_Write( hBuf2, str, strlen(str))
- ;read
- RemoteBuf_Read( hBuf1, str, 10 )
- out = %str%
- RemoteBuf_Read( hBuf2, str, 10 )
- out = %out%%str%
- MsgBox %out%
- ;close
- RemoteBuf_Close( hBuf1 )
- RemoteBuf_Close( hBuf2 )
- (end code)
- */
- /*-------------------------------------------------------------------------------------------------------------------
- Group: About
- o Ver 2.0 by majkinetor. See http://www.autohotkey.com/forum/topic12251.html
- o Code updates by infogulch
- o Licenced under Creative Commons Attribution-Noncommercial <http://creativecommons.org/licenses/by-nc/3.0/>.
- */
- guiclose:
- exitapp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement