Jump to content

help plz? (open ini)


Recommended Posts

i need a way to open my ini inside my program...

this is what i got so far:

$iok = {INS}
HotKeySet($iok, "OpenIni")
Func OpenIni()
    $file = FileOpen ("ray.ini", 0)
    If $file = -1 Then
        MsgBox(0, "Error", "Unable to open file.",$md)
    Else
        MsgBox(64, "", "ini File opened", $md)
    EndIf
   ;FileClose($file)
EndFunc

when i pres INS is will say that the file is opened but i never see the window of it being opened :)

can someone help me plz :whistle::)

Link to comment
Share on other sites

i need a way to open my ini inside my program...

this is what i got so far:

$iok = {INS}
HotKeySet($iok, "OpenIni")
Func OpenIni()
    $file = FileOpen ("ray.ini", 0)
    If $file = -1 Then
        MsgBox(0, "Error", "Unable to open file.",$md)
    Else
        MsgBox(64, "", "ini File opened", $md)
    EndIf
  ;FileClose($file)
EndFunc

when i pres INS is will say that the file is opened but i never see the window of it being opened :)

can someone help me plz :whistle::)

Its cuz you're script has nothing to keep it active,

Common mistake,

try this

$iok = {INS}
HotKeySet($iok, "OpenIni")

While 1
Sleep(1000)
Wend

Func OpenIni()
    $file = FileOpen ("ray.ini", 0)
    If $file = -1 Then
        MsgBox(0, "Error", "Unable to open file.",$md)
    Else
        MsgBox(64, "", "ini File opened", $md)
    EndIf
  ;FileClose($file)
EndFunc
Link to comment
Share on other sites

not working still..

i made a side program 2 testand get it.. added new stuff:

$iok = "{DEL}"
$ek = "{END}"
$md = 1
HotKeySet($iok, "OpenIni")
HotKeySet($ek, "Terminate")
While 1
Sleep(1000)
Wend

Func OpenIni()
    $file = FileOpen ("WMO.ini", 1)
    If $file = -1 Then
        MsgBox(0, "Error", "Unable to open file.",$md)
    Else
        MsgBox(64, "", "ini File opened", $md)
    EndIf
 ;FileClose($file)
EndFunc

Func Terminate()
    Exit 0
EndFunc

heres full script

;Other$$
    $game = IniRead("WMO.ini", "Other", "game", "NotFound")
    $ct = IniRead("WMO.ini", "Other", "timestocast", "NotFound")

;Delays
    $smn = IniRead("WMO.ini", "Delays", "sitmin", "NotFound")
    $smx = IniRead("WMO.ini", "Delays", "sitmax", "NotFound")
    $sm = IniRead("WMO.ini", "Delays", "sitdelay", "NotFound")
    $wmn = IniRead("WMO.ini", "Delays", "waitmin", "NotFound")
    $wmx = IniRead("WMO.ini", "Delays", "waitmax", "NotFound")
    $wm = IniRead("WMO.ini", "Delays", "waitdelay", "NotFound")
    $sd = IniRead("WMO.ini", "Delays", "skilldelay", "NotFound")
    $md = IniRead("WMO.ini", "Delays", "messagedelay", "NotFound")

;Skills / Keys pressed
    $ms = IniRead("WMO.ini", "Keys", "mainskill", "NotFound")
    $s2 = IniRead("WMO.ini", "Keys", "secondskill", "NotFound")
    $s3 = IniRead("WMO.ini", "Keys", "thirdskill", "NotFound")
    $s4 = IniRead("WMO.ini", "Keys", "fourthskill", "NotFound")
    $s5 = IniRead("WMO.ini", "Keys", "fifthskill", "NotFound")
    $s6 = IniRead("WMO.ini", "Keys", "sixthskill", "NotFound")
    $s7 = IniRead("WMO.ini", "Keys", "seventhskill", "NotFound")
    $s8 = IniRead("WMO.ini", "Keys", "eighthkill", "NotFound")
    $s9 = IniRead("WMO.ini", "Keys", "ninthkill", "NotFound")
    $sk = IniRead("WMO.ini", "Keys", "sitkey", "NotFound")
    $ek = IniRead("WMO.ini", "Keys", "endkey", "NotFound")
    $pk = IniRead("WMO.ini", "Keys", "pausekey", "NotFound")
    $stk = IniRead("WMO.ini", "Keys", "startkey", "NotFound")
    $irk = IniRead("WMO.ini", "Keys", "iniload", "NotFound")
    $iok = IniRead("WMO.ini", "Keys", "iniopen", "NotFound")
    
WinActivate($game)
HotKeySet($ek, "Terminate")
HotKeySet($pk, "HoldTime")
HotKeySet($stk, "StartTime")
HotKeySet($irk, "IniLoad")
HotKeySet($iok, "OpenIni")
$x = 1
While $x > 0
    While $x = 1
        For $e = 1 to $ct
            IF WinActive ( $game ) = 0 Then WinActivate($game )
            Send ($ms)
            If $e < $ct then
                $y = Random($smn, $smx, 1) ; generate an integer between -100 and 100
                Sleep ($sd + $y)
            EndIf
        Next
        $R = Random($smn, $smx, 1) ; generate an integer between -100 and 100
        Sleep ($sm + $R)
        IF WinActive ( $game ) = 0 Then WinActivate($game )
        For $a = 1 to ($ct + 3)
            Send ($sk)
        Next
        $S = Random(-$wmn, $wmx, 1) ; generate an integer between -5000 and 5000
        Sleep (($wm * $ct) + $S)
    WEnd
WEnd


Func HoldTime()
    $x = 2
    MsgBox(48, "", "Paused", $md)
EndFunc
Func StartTime()
    MsgBox(48, "", "Started", $md)
    $x = 1
EndFunc
Func Terminate()
    Exit 0
EndFunc
Func IniLoad()
    MsgBox(64, "", "InI reloaded", $md)
;Other
        $game = IniRead("WMO.ini", "Other", "game", "NotFound")
        $ct = IniRead("WMO.ini", "Other", "timestocast", "NotFound")

;Delays
        $smn = IniRead("WMO.ini", "Delays", "sitmin", "NotFound")
        $smx = IniRead("WMO.ini", "Delays", "sitmax", "NotFound")
        $sm = IniRead("WMO.ini", "Delays", "sitdelay", "NotFound")
        $wmn = IniRead("WMO.ini", "Delays", "waitmin", "NotFound")
        $wmx = IniRead("WMO.ini", "Delays", "waitmax", "NotFound")
        $wm = IniRead("WMO.ini", "Delays", "waitdelay", "NotFound")
        $sd = IniRead("WMO.ini", "Delays", "skilldelay", "NotFound")
        $md = IniRead("WMO.ini", "Delays", "messagedelay", "NotFound")

;Skills / Keys pressed
        $ms = IniRead("WMO.ini", "Keys", "mainskill", "NotFound")
        $s2 = IniRead("WMO.ini", "Keys", "secondskill", "NotFound")
        $s3 = IniRead("WMO.ini", "Keys", "thirdskill", "NotFound")
        $s4 = IniRead("WMO.ini", "Keys", "fourthskill", "NotFound")
        $s5 = IniRead("WMO.ini", "Keys", "fifthskill", "NotFound")
        $s6 = IniRead("WMO.ini", "Keys", "sixthskill", "NotFound")
        $s7 = IniRead("WMO.ini", "Keys", "seventhskill", "NotFound")
        $s8 = IniRead("WMO.ini", "Keys", "eighthkill", "NotFound")
        $s9 = IniRead("WMO.ini", "Keys", "ninthkill", "NotFound")
        $sk = IniRead("WMO.ini", "Keys", "sitkey", "NotFound")
        $ek = IniRead("WMO.ini", "Keys", "endkey", "NotFound")
        $pk = IniRead("WMO.ini", "Keys", "pausekey", "NotFound")
        $stk = IniRead("WMO.ini", "Keys", "startkey", "NotFound")
        $irk = IniRead("WMO.ini", "Keys", "inireload", "NotFound")
EndFunc
Func OpenIni()
    While 1
        Sleep(1000)
    Wend
;FileOpenDialog ( "WMO.ini", "WMO.ini", "ini (*.ini*)",)
    $file = FileOpen ("WMO.ini", 0)
    If $file = -1 Then
        MsgBox(0, "Error", "Unable to open file.",$md)
    Else
        MsgBox(64, "", "ini File opened", $md)
    EndIf
;FileClose($file)
EndFunc
Edited by Golbez
Link to comment
Share on other sites

when i pres INS is will say that the file is opened but i never see the window of it being opened :)

can someone help me plz :whistle::)

FileOpen() is a function to read or write with AutoIt in a file. It returns a file "handle" for use with subsequent file functions like 'FileRead()', 'FileWrite( )' etc.

If you want to open your 'ray.ini' in a window to write in try this:

Run('notepad.exe ray.ini')
Link to comment
Share on other sites

FileOpen() is a function to read or write with AutoIt in a file. It returns a file "handle" for use with subsequent file functions like 'FileRead()', 'FileWrite( )' etc.

If you want to open your 'ray.ini' in a window to write in try this:

Run('notepad.exe ray.ini')
Oh... I thought...

DUH!! I missed that

You don't need to 'FileOpen()' .INI files When you 'IniRead()' them

Link to comment
Share on other sites

FileOpen() is a function to read or write with AutoIt in a file. It returns a file "handle" for use with subsequent file functions like 'FileRead()', 'FileWrite( )' etc.

If you want to open your 'ray.ini' in a window to write in try this:

Run('notepad.exe ray.ini')

thanx u solved my problem :)

i love u :whistle:

im just wondering..

is there a way to make it open the ini in SciTe?

Run('SciTe.exe ray.ini')

this didnt work

Edited by Golbez
Link to comment
Share on other sites

ok well i got it 2 open in scite but can how do i set it 2 a varable.. i keep getting errors saying it cant exicute the program when it is a varable..

code:

$iok = "{DEL}"
$ek = "{END}"
$md = 1
;$fd = "C:\Program Files\AutoIt3\SciTE\SciTe.exe"
$fd = "notepad.exe"
HotKeySet($iok, "OpenIni")
HotKeySet($ek, "Terminate")

While 1
Sleep(1000)
Wend

Func OpenIni()
    MsgBox(64, "", "ini File opened", $md)
    Run('C:\Program Files\AutoIt3\SciTE\SciTe.exe ray.ini')
EndFunc


Func Terminate()    
    Exit 0
EndFunc
Link to comment
Share on other sites

Modify this line:

Run('C:\Program Files\AutoIt3\SciTE\SciTe.exe ray.ini')oÝ÷ ÚÚ-+ºÚ"µÍ[   ÌÍÙ  [È ÌÎNÈ^K[IÌÎNÊ

#)

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...