Jump to content
Sign in to follow this  
denbagoos

Need help on API

Recommended Posts

denbagoos

I make a trainer for Idol Street/5Street/Hot Step so player just press space or ctrl n not press key for arrow anymore

this is my script

#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <Timers.au3>
#include "NomadMemory.au3"
#include <Array.au3>
Opt("MustDeclareVars", 0)

Global $iMemo
Global $iTimer2,$i=1,$nilai=32
global $Process1 = WinGetProcess("Idol Street")
global $Mem_Open = _MemoryOpen($Process1)
global $Mem_Read,$Tampung,$Mem_Read,$Narrow,$avArray,$radio_1,$radio_2,$ket,$Panah
_Example_Events()

Func _Example_Events()
    Local $hGUI, $btn_change, $iWait, $btn_state
    
    $hGUI = GUICreate("Goyang Patah²", 220,150)
    $label1= GUICtrlCreateLabel("Address",15,20,40)
    $iMemo = GuiCtrlCreateInput("",70,20, 120,20)       
    $interval = GuiCtrlCreateInput("1000",70,50,50,20)  
    $label2= GUICtrlCreateLabel("Interval",15,53,40)
    $label3= GUICtrlCreateLabel("Mode",15,83,40)
    $radio_1 = GUICtrlCreateRadio("D4", 70, 80, 40, 20)
    $radio_2 = GUICtrlCreateRadio("D8", 120, 80, 40, 20)
    $btn_state = GUICtrlCreateButton("Run",  15, 120, 50)
    $btn_change = GUICtrlCreateButton( "Keluar", 75, 120, 50)
    GUICtrlSetState($radio_2, $GUI_CHECKED)
    
    GUISetState()

    GUIRegisterMsg($WM_TIMER, "WM_TIMER")   

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $btn_state
                If GUICtrlRead($btn_state) = "Run" Then
                    
                    global $Mem_Address = '0x' & GUICtrlRead($iMemo)
                    $iWait = GUICtrlRead($interval)
                    $Panah='0x' & hex($Mem_Address - 512)   
                    
                    Dim $avArray[13]
                    $avArray[0] = '0x' & hex($Panah)
                    $avArray[1] = '0x' & Hex($Panah+($nilai*1))
                    $avArray[2] = '0x' & Hex($Panah+($nilai*2))
                    $avArray[3] = '0x' & Hex($Panah+($nilai*3))
                    $avArray[4] = '0x' & Hex($Panah+($nilai*4))
                    $avArray[5] = '0x' & Hex($Panah+($nilai*5))
                    $avArray[6] = '0x' & Hex($Panah+($nilai*6))
                    $avArray[7] = '0x' & Hex($Panah+($nilai*7))
                    $avArray[8] = '0x' & Hex($Panah+($nilai*8))
                    $avArray[9] = '0x' & Hex($Panah+($nilai*9))
                    $avArray[10] = '0x' & Hex($Panah+($nilai*10))
                    $avArray[11] = '0x' & Hex($Panah+($nilai*11))
                    $avArray[12] = '0x' & Hex($Panah+($nilai*12))
                    
                    $iTimer2 = _Timer_SetTimer($hGUI, $iWait); create timer
                    If @error Or $iTimer2 = 0 Then ContinueLoop
                    GUISetState(@SW_MINIMIZE)
                    GUICtrlSetData($btn_state, "Stop")
                    GUICtrlSetState($iMemo, $GUI_DISABLE)
                    GUICtrlSetState($interval, $GUI_DISABLE)
                    GUICtrlSetState($radio_1, $GUI_DISABLE)
                    GUICtrlSetState($radio_2, $GUI_DISABLE)
                Else                    
                    _Timer_KillTimer($hGUI, $iTimer2)
                    GUICtrlSetData($btn_state, "Run")
                    GUICtrlSetState($iMemo, $GUI_ENABLE)
                    GUICtrlSetState($interval, $GUI_ENABLE)
                    GUICtrlSetState($radio_1, $GUI_ENABLE)
                    GUICtrlSetState($radio_2, $GUI_ENABLE)
                EndIf
                
            Case $btn_change
                Terminate()
        EndSwitch
    WEnd    
EndFunc 

; Timer Events
Func WM_TIMER()
    #forceref $hWnd, $iMsg, $ilParam    
    If BitAND(GUICtrlRead($radio_1), $GUI_CHECKED) = $GUI_CHECKED Then  
        _GoyangD4()
    ElseIf BitAND(GUICtrlRead($radio_2), $GUI_CHECKED) = $GUI_CHECKED Then  
        _GoyangD8()
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc   



Func _GoyangD4()
    $Mem_Read = _MemoryRead($Mem_Address, $Mem_Open)    
        For $i=1 to $Mem_Read
            if $i=1 Then
                $Narrow=''                      
            EndIf                           
                $Narrow = $Narrow & _MemoryRead($avArray[$i-1], $Mem_Open)  
        Next 
        
    If $Tampung <> $Narrow And $Mem_Read<>0 Then        
            
            for $i=1 to $Mem_Read
                
                if $i=1 Then
            ;Send("{Enter}")                    
            ;Sleep(50)
            ;Send("{#}")
                EndIf
                
                if StringMid($Narrow,$i,1) =0 Then
                        Send("a")
                    ElseIf StringMid($Narrow,$i,1) =1 Then
                        Send("w" )
                    ElseIf StringMid($Narrow,$i,1) =2 Then
                        Send("d")
                    Elseif StringMid($Narrow,$i,1) =3 Then
                        Send("s")
                    Elseif StringMid($Narrow,$i,1) =4 Then
                        Send("{NUMPAD7}")
                    Elseif StringMid($Narrow,$i,1) =5 Then
                        Send("{NUMPAD1}")
                    Elseif StringMid($Narrow,$i,1) =6 Then
                        Send("{NUMPAD9}")
                    Elseif StringMid($Narrow,$i,1) =7 Then
                        Send("{NUMPAD3}")
                EndIf
                if $i=$Mem_Read Then
            ;Sleep(400)
            ;Send("{Enter}")
                EndIf   
            Next
    EndIf
    $Tampung = $Narrow

EndFunc

Func _GoyangD8()    
    $Mem_Read = _MemoryRead($Mem_Address, $Mem_Open)    
;GUICtrlSetData($ket, "Arrow : " & $Mem_Read)
        For $i=1 to $Mem_Read
            if $i=1 Then
                $Narrow=''                      
            EndIf                           
                $Narrow = $Narrow & _MemoryRead($avArray[$i-1], $Mem_Open)  
        Next 
        
    If $Tampung <> $Narrow And $Mem_Read<>0 Then            
            
            for $i=1 to $Mem_Read
                
                if $i=1 Then
            ;Send("{Enter}")                    
            ;Sleep(50)
            ;Send("{#}")
                EndIf
                
                if StringMid($Narrow,$i,1) =0 Then
                        Send("{NUMPAD4}")
                    ElseIf StringMid($Narrow,$i,1) =1 Then
                        Send("{NUMPAD8}" )
                    ElseIf StringMid($Narrow,$i,1) =2 Then
                        Send("{NUMPAD6}")
                    Elseif StringMid($Narrow,$i,1) =3 Then
                        Send("{NUMPAD2}")
                    Elseif StringMid($Narrow,$i,1) =4 Then
                        Send("{NUMPAD7}")
                    Elseif StringMid($Narrow,$i,1) =5 Then
                        Send("{NUMPAD1}")
                    Elseif StringMid($Narrow,$i,1) =6 Then
                        Send("{NUMPAD9}")
                    Elseif StringMid($Narrow,$i,1) =7 Then
                        Send("{NUMPAD3}")
                EndIf
                if $i=$Mem_Read Then
            ;Sleep(400)
            ;Send("{Enter}")
                EndIf   
            Next
    EndIf
    $Tampung = $Narrow
EndFunc 

Func Terminate()
    _MemoryClose($Mem_Open)
    Exit
EndFunc

its work for me

the problem is,i have to type for address manually because i don't know how to get pointer

the pointer is located in module that loaded by main process (idolstreet.exe)

so i wanna know how to get that module's address by module's name (its name is dancegame.dll) inside idolstreet.exe

i need your help here...

Edited by denbagoos

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.