Quote:
Originally Posted by phat34
He's going to have to initialize to use that code. Why not give him a working script.
|
hes saying he's modifying a bot i assumed he wouldn't need a full script, but sure
Code:
#NoTrayIcon
#include <MsgBoxConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiEdit.au3>
#include "GWA2.au3"
Opt("GUIOnEventMode", True) ; enable gui on event mode
Global $boolInitialized = False
Global $boolRunning = False
Global Const $SleepTime = 250 ; in milliseconds
Global Const $MainGui = GUICreate("Item Model ID", 300, 118)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
GUICtrlCreateLabel("Name", 8, 6, 156, 17, $SS_CENTER)
Global Const $inputCharName = GUICtrlCreateCombo("", 8, 24, 150, 22)
GUICtrlSetData(-1, GetLoggedCharNames())
Global Const $btnStart = GUICtrlCreateButton("Start", 90, 68, 60)
GUICtrlSetOnEvent($btnStart, "EventHandler")
GUISetOnEvent($GUI_EVENT_CLOSE, "EventHandler")
GUISetState(@SW_SHOW)
Func Main ()
Do
Sleep(100)
Until $boolInitialized
While 1
If ($boolRunning) Then
$Item1 = GetItemBySlot(1, 1)
$Item2 = GetItemBySlot(1, 2)
$Item3 = GetItemBySlot(1, 3)
MsgBox(0, "" , "1ยบ item model is " & DllStructGetData($Item1, "ModelID"));
MsgBox(0, "" , "2ยบ item model is " & DllStructGetData($Item2, 'ModelID'))
MsgBox(0, "" , "3ยบ Item Model is " & DllStructGetData($Item3, 'ModelID'))
$boolRunning = False
EndIf
Sleep(100)
WEnd
EndFunc
Func EventHandler()
Switch [MENTION=3027413]Gui_[/MENTION]CtrlId
Case $GUI_EVENT_CLOSE
Exit
Case $btnStart
If $boolRunning Then
GUICtrlSetData($btnStart, "Resume")
$boolRunning = False
ElseIf $boolInitialized Then
GUICtrlSetData($btnStart, "Get ID")
$boolRunning = True
Else
$boolRunning = True
GUICtrlSetData($btnStart, "Initializing...")
GUICtrlSetState($btnStart, $GUI_DISABLE)
GUICtrlSetState($inputCharName, $GUI_DISABLE)
WinSetTitle($MainGui, "", GUICtrlRead($inputCharName))
If GUICtrlRead($inputCharName) = "" Then
If Initialize(ProcessExists("gw.exe")) = False Then ; don't need string logs or event system
MsgBox(0, "Error", "Guild Wars it not running.")
Exit
EndIf
Else
If Initialize(GUICtrlRead($inputCharName)) = False Then ; don't need string logs or event system
MsgBox(0, "Error", "Can't find a Guild Wars client with that character name.")
Exit
EndIf
EndIf
GUICtrlSetData($btnStart, "Get ID")
GUICtrlSetState($btnStart, $GUI_ENABLE)
$boolInitialized = True
EndIf
EndSwitch
EndFunc
Main()
BTW an non insc Gold Shadow Bow Model ID was 143, not sure all shadow bows will have this Model ID but give it a try