Sign in to follow this  
Followers 0
fataly

Help me fast iniread

9 posts in this topic

#1 ·  Posted (edited)

ok, i maked this scirpt. its allways choose char1 or world1 . why its not working?

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)

$world1 = IniRead("Options.ini","AccountandPassword","world1","")
$world2 = IniRead("Options.ini","AccountandPassword","world2","")
$world3 = IniRead("Options.ini","AccountandPassword","world3","")
$char1 = IniRead("Options.ini","AccountandPassword","char1","")
$char2 = IniRead("Options.ini","AccountandPassword","char2","")
$char3 = IniRead("Options.ini","AccountandPassword","char3","")


If $world1 = IniRead("Options.ini","AccountandPassword","world1","yes") then
world1()

Elseif $world2 = IniRead("Options.ini","AccountandPassword","world2","yes") then
world2()

ElseIf $world3 = IniRead("Options.ini","AccountandPassword","world3","yes") then
world3()

EndIf

If $char1 = IniRead("Options.ini","AccountandPassword","char1","yes") then
char1()
toolTip("Start Hunting", 200,200,"Compeleted")

ElseIf $char2 = IniRead("Options.ini","AccountandPassword","char2","yes") then
char2()
toolTip("Start Hunting", 200,200,"Compeleted")

ElseIf $char2 = IniRead("Options.ini","AccountandPassword","char2","yes") then
char1()
ToolTip("Start Hunting", 200,200,"Compeleted")

EndIf

Func world1()
        Sleep(100)
ToolTip("World 1 Selected.", 10,710,"Joining..")
    Sleep(1000)
    MouseMove(452,399)
MouseDown("left")
MouseUp("left")
Sleep(1000)
MouseMove(516,646)
MouseDown("left")
MouseUp("left")
Sleep(12000)
EndFunc

Func world2()
    ToolTip("World 2 Selected.", 10,710,"Joining..")
        Sleep(1000)
MouseMove(464,418)
MouseDown("left")
MouseUp("left")
        Sleep(1000)
MouseMove(509,659)
MouseDown("left")
MouseUp("left")
sleep(12000)
EndFunc

Func world3()
    ToolTip("World 3 Selected.", 10,710,"Joining..")
sleep(1000)
MouseMove(453,443)
MouseDown("left")
MouseUp("left")
        Sleep(1000)
MouseMove(519,658)
MouseDown("left")
MouseUp("left")
sleep(12000)
EndFunc

Func char1()
    Sleep(100)
ToolTip("Character 1 Selected.", 10,710,"Select character.")
Sleep(2000)
MouseMove(513,594)
Sleep(100)
MouseDown("left")
MouseUp("left")
sleep(2000)
Send("{LEFT}")
Sleep(500)
Send("{enter}")
Sleep(100)
Sleep(15000)
EndFunc

Func char2()
    Sleep(100)
ToolTip("Character 2 Selected.", 445,710,"Select character.")
Sleep(2000)
MouseMove(513,594)
Sleep(100)
MouseDown("left")
MouseUp("left")
sleep(2000)
Send("{enter}")
Sleep(15000)
EndFunc

Func char3()
    Sleep(100)
ToolTip("Character 3 Selected.", 890,710,"Select character.")
Sleep(2000)
MouseMove(513,594)
Sleep(100)
MouseDown("left")
MouseUp("left")
sleep(2000)
Send("{RIGHT}")
Send("{enter}")
Sleep(15000)
EndFunc

there is .ini

---Type these your account and password---

---type "yes" in that world what you want join, and other worlds "no".

---world1 is evengarda

---wolrd2 is gaiahon

---wolrd3 is brumhart

---char1 is first char in right, char2 is second char in midle, char3 is left char and last ---char in archlord char.

[AccountandPassword]

world1=Yes

world2=no

world3=no

char1=no

char2=yes

char3=no

Edited by SmOke_N
Added code tags

Share this post


Link to post
Share on other sites

and .ini file is same folder whit scirpt and its name is writet right.

Share this post


Link to post
Share on other sites

Your script reads the .ini file for $World1 and $Char1, then reads the same .ini file again a millisecond later. No surprise it gets the same value and they are equal, so the first lines of the If statements are true.

It's just like doing:

$a = 'yes'
If $a = 'yes' Then MsgBox(64, 'Yes', 'Yes')

Of course the compare will always come out true.

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

hmm... where i put that $a = 'yes'?

like:

$a = IniRead("Options.ini","AccountandPassword","world1","")

If $a = 'yes' Then

world1()

?

becuase i dont understunts your infos:)))

Share this post


Link to post
Share on other sites

hmm... where i put that $a = 'yes'?

like:

$a = IniRead("Options.ini","AccountandPassword","world1","")

If $a = 'yes' Then

world1()

?

becuase i dont understunts your infos:)))

I think you got the right idea. Read the value once, then compare that with whatever you are looking for. Modifying your original:

$world1 = IniRead("Options.ini","AccountandPassword","world1","yes")
; ...
$char1 = IniRead("Options.ini","AccountandPassword","char1","yes")
; ...

If $world1 = "yes" then 
    world1()

; ... ElseIf etc.

EndIf

If $char1 = "yes" then
    char1()
    toolTip("Start Hunting", 200,200,"Compeleted")

; ... ElseIf etc.

EndIf

Note the use of the default value "yes" on the IniRead(). If the key isn't set, you'll get "yes" by default. That seems to be what you were trying to do.

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

i want use other char and other wolrd, what i need to do?

Share this post


Link to post
Share on other sites

Read the example for IniReadSection? :P

Share this post


Link to post
Share on other sites

i want use other char and other wolrd, what i need to do?

Let's simplify the demo:

$world1 = IniRead("Options.ini", "AccountandPassword", "world1", "yes")
$world2 = IniRead("Options.ini", "AccountandPassword", "world2", "yes")
$world3 = IniRead("Options.ini", "AccountandPassword", "world3", "yes")

If $world1 = "yes" Then
    MsgBox(64, "Result", "world1()")
ElseIf $world2 = "yes" Then
    MsgBox(64, "Result", "world2()")
ElseIf $world3 = "yes" Then
    MsgBox(64, "Result", "world3()")
EndIf

Here's the Options.ini file:

[AccountandPassword]

world1=no
world2=Yes
world3=no

This demo will pop a MsgBox that says "world2()", because that's the one set to "yes". You can replace the MsgBox() with whatever else you want the script to do, but does this make sense so far?

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

ty much:D

Share this post


Link to post
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
Sign in to follow this  
Followers 0