#include #include $title = "Nightmist Character Generation " $title_manage = "Account Manager - Nightmist" $race = "ThunderRT6OptionButton53" $class = "ThunderRT6OptionButton47" $sex = "ThunderRT6OptionButton58" $str = 0 $int = 0 $dex = 0 $con = 0 $wis = 0 $cha = 0 $cbstr = 0 $cbint = 0 $cbdex = 0 $cbcon = 0 $cbwis = 0 $cbcha = 0 $total = 0 $catch = 0 Opt("WinTitleMatchMode",2) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode", 2) Opt("PixelCoordMode", 2) GuiCreate("Nightmist Crit-Gen", 259, 200,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Group_1 = GuiCtrlCreateGroup("Info", 10, 10, 170, 150) $Input_3 = GuiCtrlCreateInput("", 60, 50, 110, 20) $Label_4 = GuiCtrlCreateLabel("Name:", 20, 50, 30, 20) $Label_5 = GuiCtrlCreateLabel("Race:", 20, 90, 30, 20) $Combo_6 = GuiCtrlCreateCombo("Dwarf", 60, 90, 110, 21) GUICtrlSetData($Combo_6,"Halfling|Elf|Human|HalfElf|Gnome|HalfOrc") $Combo_7 = GuiCtrlCreateCombo("Fighter", 60, 130, 110, 21) GUICtrlSetData($Combo_7,"Berserker|Mage|Pacifist|Cleric|Druid|Paladin|Ranger|Thief") $Label_8 = GuiCtrlCreateLabel("Class:", 20, 130, 30, 20) $Group_9 = GuiCtrlCreateGroup("Stats", 190, 10, 60, 150) $Checkbox_10 = GuiCtrlCreateCheckbox("STR", 200, 30, 40, 20) $Checkbox_11 = GuiCtrlCreateCheckbox("INT", 200, 50, 40, 20) $Checkbox_12 = GuiCtrlCreateCheckbox("DEX", 200, 70, 40, 20) $Checkbox_13 = GuiCtrlCreateCheckbox("CON", 200, 90, 40, 20) $Checkbox_14 = GuiCtrlCreateCheckbox("WIS", 200, 110, 40, 20) $Checkbox_15 = GuiCtrlCreateCheckbox("CHA", 200, 130, 40, 20) $Button_18 = GUICtrlCreateButton("Roll", 10, 167, 240, 25) $Radio_19 = GUICtrlCreateRadio("Male", 60, 20) $Radio_20 = GUICtrlCreateRadio("Female", 115, 20) GUICtrlSetState($Radio_19, $GUI_CHECKED) GuiSetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_18 If GUICtrlRead($Checkbox_10) = $GUI_CHECKED Then $cbstr = 1 If GUICtrlRead($Checkbox_11) = $GUI_CHECKED Then $cbint = 1 If GUICtrlRead($Checkbox_12) = $GUI_CHECKED Then $cbdex = 1 If GUICtrlRead($Checkbox_13) = $GUI_CHECKED Then $cbcon = 1 If GUICtrlRead($Checkbox_14) = $GUI_CHECKED Then $cbwis = 1 If GUICtrlRead($Checkbox_15) = $GUI_CHECKED Then $cbcha = 1 $cbtotal = $cbstr + $cbint + $cbdex + $cbcon + $cbwis + $cbcha $crit_name = GUICtrlRead($Input_3) Select Case GUICtrlRead($Combo_6) = "Dwarf" $race = "ThunderRT6OptionButton55" Case GUICtrlRead($Combo_6) = "Halfling" $race = "ThunderRT6OptionButton54" Case GUICtrlRead($Combo_6) = "Elf" $race = "ThunderRT6OptionButton53" Case GUICtrlRead($Combo_6) = "Human" $race = "ThunderRT6OptionButton52" Case GUICtrlRead($Combo_6) = "HalfElf" $race = "ThunderRT6OptionButton51" Case GUICtrlRead($Combo_6) = "Gnome" $race = "ThunderRT6OptionButton56" Case GUICtrlRead($Combo_6) = "HalfOrc" $race = "ThunderRT6OptionButton50" Case Else ;;;; EndSelect Select Case GUICtrlRead($Combo_7) = "Fighter" $class = "ThunderRT6OptionButton46" Case GUICtrlRead($Combo_7) = "Berserker" $class = "ThunderRT6OptionButton45" Case GUICtrlRead($Combo_7) = "Mage" $class = "ThunderRT6OptionButton48" Case GUICtrlRead($Combo_7) = "Pacifist" $class = "ThunderRT6OptionButton44" Case GUICtrlRead($Combo_7) = "Cleric" $class = "ThunderRT6OptionButton47" Case GUICtrlRead($Combo_7) = "Ranger" $class = "ThunderRT6OptionButton41" Case GUICtrlRead($Combo_7) = "Thief" $class = "ThunderRT6OptionButton42" Case GUICtrlRead($Combo_7) = "Druid" $class = "ThunderRT6OptionButton49" Case GUICtrlRead($Combo_7) = "Paladin" $class = "ThunderRT6OptionButton43" Case Else ;;;; EndSelect If GUICtrlRead($Radio_20) = $GUI_CHECKED Then $sex = "ThunderRT6OptionButton57" EndIf Beginner() Case Else ;;;; EndSelect While $catch = 1 Pixels() If Not $catch Then ExitLoop RollClick() Sleep(400) CheckMath() Pixels() WEnd WEnd Exit Func Beginner() If Not WinExists($title, "") AND Not WinExists($title_manage, "") Then _RunDOS('"C:\NMRoller.lnk"') WinWait($title_manage, "") EndIf If WinExists($title_manage,"") Then If Not WinActive($title_manage,"") Then WinActivate($title_manage,"") WinWaitActive($title_manage,"") ControlClick($title_manage, "","ThunderRT6CommandButton2") WinWait($title,"") EndIf If Not WinActive($title,"") Then WinActivate($title,"") WinWaitActive($title,"") If "Next" == ControlGetText($title, "", "ThunderRT6CommandButton1") Then Send($crit_name) Sleep(1000) ControlClick($title, "","ThunderRT6CommandButton1") Sleep(1000) EndIf ControlClick($title, "",$race) $catch = 1 EndFunc Func RollClick() If NOT PixelGetColor(58,444) Then ControlClick($title, "Reroll", "ThunderRT6CommandButton3") EndFunc Func Pixels() If $cbstr Then $str_check = PixelSearch(104, 304, 119, 312, 0xD3D01E, 40) If Not @error Then $str = 1 ;NMsgBox("STR") EndIf Sleep(10) EndIf If $cbint Then $int_check = PixelSearch(104, 326, 119, 334, 0xD5E143, 40) If Not @error Then $int = 1 ;NMsgBox("INT") EndIf Sleep(10) EndIf If $cbdex Then $dex_check = PixelSearch( 104, 348, 119, 353, 0xB4CA25, 40) If Not @error Then $dex = 1 ;NMsgBox("DEX") EndIf Sleep(10) EndIf If $cbcon Then $con_check = PixelSearch( 104, 370, 119, 378, 0xD7DB47, 40) If Not @error Then $con = 1 ;NMsgBox("CON") EndIf Sleep(10) EndIf If $cbwis Then $wis_check = PixelSearch( 104, 391, 119, 399, 0xB3C522, 40) If Not @error Then $wis = 1 ;NMsgBox("WIS") EndIf Sleep(10) EndIf If $cbcha Then $cha_check = PixelSearch( 104, 412, 119, 420, 0xD0BF1E, 40) If Not @error Then $cha = 1 ;NMsgBox("CHA") EndIf Sleep(10) EndIf $total = $str + $int + $dex + $con + $wis + $cha Sleep(100) If $total = $cbtotal Then Box() $str = 0 $int = 0 $dex = 0 $con = 0 $wis = 0 $cha = 0 EndFunc Func Box() $catch = 0 Sleep(1000) ControlClick($title, "", $sex) Sleep(1000) ControlClick($title, "",$class) Sleep(1000) ControlClick($title, "", "ThunderRT6CommandButton5") Sleep(1000) SoundPlay("C:\Documents and Settings\Murdock\My Documents\My Music\Music\Classical\Tchaikovsky - 1812 Overture.mp3") EndFunc Func CheckMath() If NOT PixelGetColor(439,328) Then MouseClick( "left", 150, 50, 1, 0) $catch = 0 Sleep(1000) Beginner() EndIf EndFunc Func NMsgBox($stat) MsgBox(0, "Stat:", $stat) EndFunc