Jump to content

Func does not work when i press a button


xXxElevenxXx
 Share

Recommended Posts

i don't kown why this func does not work

if i fill it in like this:

Posted Image

then it works fine

but if i wan't to use the . . . button and select a file then it won't work... help!

#include <GuiConstantsEx.au3>

Opt('MustDeclareVars', 1)
Opt("GUICoordMode", 0)

Global $profile_name, $Information, $Button_3, $Button_6, $Button_7, $msg, $GUI2, $Provincie[7], $i, $n, $p, $sTmpFile, $Locations[7]
Add()

Func Add()
   $GUI2 = GUICreate("Add profile", 495, 237)
   GUICtrlCreateLabel("Profile Name:", 18, 18)
   $profile_name = GuiCtrlCreateInput("", 70, -2, 200, 20)
   GuiCtrlCreateGroup("Locations Settings",-76,25,473,52)
   GUICtrlCreateLabel("Path:", 19, 21)
   $Locations = GuiCtrlCreateInput(IniRead("Settings.ini", "Locations", "Path", ""), 30, -2, 285, 20)
   GuiCtrlCreateButton("Auto Detection", 323, 0, 87, 20)
   $Button_6 = GuiCtrlCreateButton("...", -33, 0, 27, 20)
   GuiCtrlCreateGroup("Bot Settings",-339,45,474,93)
   GUICtrlCreateLabel("Account name:", 19, 21)
   GUICtrlCreateLabel("Provincie:", 300, 0)
   $Provincie[1] = GuiCtrlCreateRadio("1", 55, -3, 30)
   GUICtrlSetState($Provincie[1], $GUI_CHECKED)
   $Provincie[2] = GuiCtrlCreateRadio("2", 30, 0, 30)
   $Provincie[3] = GuiCtrlCreateRadio("3", -30, 20, 30)
   $Provincie[4] = GuiCtrlCreateRadio("4", 30, 0, 30)
   $Provincie[5] = GuiCtrlCreateRadio("5", -30, 20, 30)
   $Provincie[6] = GuiCtrlCreateRadio("6", 30, 0, 30)
   GUICtrlCreateLabel("Password:", -373, -13)
   $n = GuiCtrlCreateInput("", 68, -26, 130, 20)
   $p = GuiCtrlCreateInput("", 0, 24, 130, 20)
   $Button_7 = GuiCtrlCreateButton("Cancel", 302, 55, 74, 26)
   $Button_3 = GuiCtrlCreateButton("Ok", -80, 0, 74, 26)
   GUICtrlCreateLabel("Time:", -278, -29)
   $Information = GuiCtrlCreateInput(IniRead("Settings.ini", "Information", "Time", ""), 56, -2, 130, 20)
   GUICtrlCreateLabel("(for all profiles!!)", 135, 3)
   GUISetState()
   While 1
      $msg = GUIGetMsg($GUI2)
      Select
         Case $msg = $GUI_EVENT_CLOSE
            GUIDelete($GUI2)
            Return
         Case $msg = $Button_7
            GUIDelete($GUI2)
            Return
         Case $msg = $Button_6
            $sTmpFile = FileOpenDialog("Select File:", @DesktopDir, "Internet (*.exe)")
            GUICtrlSetData($Locations, $sTmpFile); GUI will be updated at next iteration
            $Locations = $sTmpFile
         Case $msg = $Button_3
            $i = IniRead("Settings.ini", "account", "count", "0")
            $i = $i + 1
            IniWrite("Settings.ini", "account", "count", $i)
            IniWrite("Settings.ini", "Locations", "Path", GUICtrlRead($Locations))
            IniWrite("Settings.ini", "Information", "Time", GUICtrlRead($Information))
            IniWrite("Settings.ini", "profile", "profilename" & $i, GUICtrlRead($profile_name))
            IniWrite("Settings.ini", "account", "Name" & $i, GUICtrlRead($n))
            IniWrite("Settings.ini", "account", "Password" & $i, GUICtrlRead($p))
            If $Provincie[1] And BitAND(GUICtrlRead($Provincie[1]), $GUI_CHECKED) = $GUI_CHECKED Then
               IniWrite("Settings.ini", "account", "Provincie" & $i, "1")
            ElseIf $Provincie[2] And BitAND(GUICtrlRead($Provincie[2]), $GUI_CHECKED) = $GUI_CHECKED Then
               IniWrite("Settings.ini", "account", "Provincie" & $i, "2")
            ElseIf $Provincie[3] And BitAND(GUICtrlRead($Provincie[3]), $GUI_CHECKED) = $GUI_CHECKED Then
               IniWrite("Settings.ini", "account", "Provincie" & $i, "3")
            ElseIf $Provincie[4] And BitAND(GUICtrlRead($Provincie[4]), $GUI_CHECKED) = $GUI_CHECKED Then
               IniWrite("Settings.ini", "account", "Provincie" & $i, "4")
            ElseIf $Provincie[5] And BitAND(GUICtrlRead($Provincie[5]), $GUI_CHECKED) = $GUI_CHECKED Then
               IniWrite("Settings.ini", "account", "Provincie" & $i, "5")
            ElseIf $Provincie[6] And BitAND(GUICtrlRead($Provincie[6]), $GUI_CHECKED) = $GUI_CHECKED Then
               IniWrite("Settings.ini", "account", "Provincie" & $i, "6")
            EndIf
            GUIDelete($GUI2)
            Return
      EndSelect
   WEnd
EndFunc
Link to comment
Share on other sites

  • Moderators

xXxElevenxXx,

Before we start - what are you trying to bot? You have read the announcement concerning "Game Bots" at the top of the forum I take it?

M23

Edit:

From Imperia Online rules - seems prety clear to me:

*It is forbidden to use any type of software that can harm or interfere with the correct functioning of Imperia Online.

* It is forbidden to use any bots or other ways of artificial stay online in the game. The same goes for programs that automates the actions of a player outside the mechanisms provided by the in game menu. Using public proxies to play the game is not allowed.

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...