Jump to content

not saving the $var to ini


kcd-clan
 Share

Recommended Posts

It will save the $var="whatever"

but ti will save it as a nummber.

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.0
; Program Version   1.0
; Author:           kcd-clan Josh Turner
; Website           Http://d2.rr.nu
;
; ----------------------------------------------------------------------------

MsgBox(4096, "KCD", "Welcome to KCD Bots and scripts.Our site is http://d2.rr.nu", 20)

#include <GuiConstants.au3>
Opt ("GUIOnEventMode", 1)
GUICreate("KCD Bot's Setup", 300, 300, (@DesktopWidth - 300) / 2, (@DesktopHeight - 300) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents")
$Label_1 = GUICtrlCreateLabel("Diablo 2 Location", 20, 20, 90, 20)
$Location = GUICtrlCreateInput("C:\Program Files\Diablo II", 120, 20, 160, 20)
$Label_3 = GUICtrlCreateLabel("Account Name", 20, 50, 90, 20)
$Account = GUICtrlCreateInput("Account", 120, 50, 160, 20)
$Label_5 = GUICtrlCreateLabel("Password", 20, 80, 90, 20)
$Password = GUICtrlCreateInput("Password", 120, 80, 160, 20)
$Bot2Run1 = GUICtrlCreateCombo("------------------Bot------------------", 120, 110, 160, 21)
$Bot2Run = GUICtrlSetData(-1, "D2 gSpam it|D2 Chat It", "------------------Bot------------------")
$Label_9 = GUICtrlCreateLabel("Bot2Run", 20, 110, 90, 20)
$Button_10 = GUICtrlCreateButton("Save", 120, 260, 60, 20)
GUICtrlSetOnEvent($Button_10, "save")
$Button_11 = GUICtrlCreateButton("Exit", 210, 260, 60, 20)
GUICtrlSetOnEvent($Button_11, "q")
$Button_12 = GUICtrlCreateButton("Run", 30, 260, 60, 20)
GUICtrlSetOnEvent($Button_12, "run1")
$Label_13 = GUICtrlCreateLabel("Pause", 20, 140, 90, 20)
$Label_15 = GUICtrlCreateLabel("Message 2", 20, 170, 90, 20)
$Label_16 = GUICtrlCreateLabel("Message 3", 20, 200, 90, 20)
$Label_17 = GUICtrlCreateLabel("Message 4", 20, 230, 90, 20)
$pause = GUICtrlCreateInput("Pause in seconds", 120, 140, 160, 20)
$msg1 = GUICtrlCreateInput("Message 2", 120, 170, 160, 20)
$msg2 = GUICtrlCreateInput("Message 3", 120, 200, 160, 20)
$msg3 = GUICtrlCreateInput("Message 4", 120, 230, 160, 20)
$By = GUICtrlCreateLabel("http://d2.rr.nu By Kcd-Clan", 80, 285, 200, 25)

GUISetState()

While 1
    Sleep(1000)
WEnd

Func save()
    $file = FileOpen("Config.ini", 1)
; Check if file opened for writing OK
If $file = -1 Then
    MsgBox(0, "KCD-Error", "Unable to open file.")
    Exit
EndIf
FileWriteLine($file, "[main]")
FileWriteLine($file, '$Location=' & $Location)
FileWriteLine($file, '$Account=' & $Account)
FileWriteLine($file, '$Password=' & $Password)
FileWriteLine($file, '$Bot2Run=' & $Bot2Run)
FileWriteLine($file, '$msg1=' & $msg1)
FileWriteLine($file, '$msg2=' & $msg2)
FileWriteLine($file, '$msg3=' & $msg3)
FileWriteLine($file, '$pause=' & $pause)

FileClose($file)
MsgBox(4096, "KCD-Save", "The file was saved.", 20)
EndFunc ;==>save

Func run1()
    Run("RunIt.exe", "", @SW_MAXIMIZE)
EndFunc ;==>q



Func q()
    MsgBox(4096, "KCD-Exit", "Dont forget to visit or site. http://d2.rr.nu")
    Exit
EndFunc ;==>q

Func SpecialEvents()
    Select
        Case @GUI_CtrlId = $GUI_EVENT_CLOSE
            Exit
            
        Case @GUI_CtrlId = $GUI_EVENT_MINIMIZE
            
        Case @GUI_CtrlId = $GUI_EVENT_RESTORE
            
    EndSelect
EndFunc ;==>SpecialEvents
Visit mEMy programs made.Iul - IulG-V Console - G-V Console_RandomLetter - _RandomLetter()Saftey Kill - Saftey Killcolorzone() = colorzone()
Link to comment
Share on other sites

It will save the $var="whatever"

but ti will save it as a nummber.

FileWriteLine($file, '$Location=' & $Location)

$Location, $Account, etc. are the ControlID and not the content you entered in the control. Read the follwing sections (and the samples) in the help file: GUICtrlRead(), IniWrite().

Cheers

Kurt

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
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
 Share

  • Recently Browsing   0 members

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