Sign in to follow this  
Followers 0
Warbringer

How To Get Input Data From .ini File?

10 posts in this topic

I made a auto clicker for this online game.

Everything is fine BUT the .exe only works for ONE account.

i.e. I log in with MYNAME and as password 12345

which is compiled into the script.

I would like the script to get this from a .ini file so the 'user' only has to edit the .ini file

instead of the .exe if you guys get my point lol.

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
Run('C:\Program Files\Mozilla Firefox\firefox.exe')
WinWait("Mozilla Firefox Startpagina - Mozilla Firefox","")
If Not WinActive("Mozilla Firefox Startpagina - Mozilla Firefox","") Then WinActivate("Mozilla Firefox Startpagina - Mozilla Firefox","")
WinWaitActive("Mozilla Firefox Startpagina - Mozilla Firefox","")
MouseMove(240,70)
MouseDown("left")
MouseUp("left")
Sleep(1000)
Send("http{SHIFTDOWN};{SHIFTUP}//betacrime.be.funpic.de{ENTER}")
WinWait("BétàCrime - Mozilla Firefox","")
If Not WinActive("BétàCrime - Mozilla Firefox","") Then WinActivate("BétàCrime - Mozilla Firefox","")
WinWaitActive("BétàCrime - Mozilla Firefox","")
MouseMove(132,512)
MouseDown("left")
MouseUp("left")
Sleep(1000)
MouseMove(589,339)
MouseClick("left",589,339,2)
Send("MY NAME")
MouseMove(599,358)
MouseClick("left",599,358,2)
Send("MY PASSWORD")
MouseMove(667,375)
MouseDown("left")
MouseUp("left")
Sleep(1000)

Please tell me someone :think:

Share this post


Link to post
Share on other sites



HI,

have a look at IniRead() or IniReadSection in the helpfile. The example shows everything you want.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

wow that was quick :( thank you very much!

cheers ;)

but can u show me how to do it plz? :think:

IniRead ( "filename", "section", "key", "default" )

and

Send("MY NAME")

so how do I fuse them? I want him to SEND the thing in the .ini file...

IniRead ( "info.ini", "DATA", "$password$", "default" )

so it will look in the file called info.ini under the section [DATA] at the

key called $password$ and if it is not there it will go back to default value...

But where do I put the password in the IniRead code?

sorry for being such a noob, its my 1st time but when I did it 1 time I wont ever forget it :)

Edited by Warbringer

Share this post


Link to post
Share on other sites

HI,

try this

$var = IniReadSection(@ScriptDir & "\test.ini", "UserPassword")
If @error Then 
    MsgBox(4096, "", "Error occured, probably no INI file.")
Else
    For $i = 1 To $var[0][0]
        MsgBox(4096, "", "Key: " & $var[$i][0] & @CRLF & "Value: " & $var[$i][1])
    Next
EndIf

IniFile

[UserPassword]
Name=Password

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

HI,

or improve this version.

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

Dim $var = 0

Run('C:\Program Files\Mozilla Firefox\firefox.exe')
WinWait("Mozilla Firefox Startpagina - Mozilla Firefox","")
If Not WinActive("Mozilla Firefox Startpagina - Mozilla Firefox","") Then WinActivate("Mozilla Firefox Startpagina - Mozilla Firefox","")
WinWaitActive("Mozilla Firefox Startpagina - Mozilla Firefox","")
MouseMove(240,70)
MouseDown("left")
MouseUp("left")
Sleep(1000)
Send("http{SHIFTDOWN};{SHIFTUP}//betacrime.be.funpic.de{ENTER}")
WinWait("BétàCrime - Mozilla Firefox","")
If Not WinActive("BétàCrime - Mozilla Firefox","") Then WinActivate("BétàCrime - Mozilla Firefox","")
WinWaitActive("BétàCrime - Mozilla Firefox","")
MouseMove(132,512)
MouseDown("left")
MouseUp("left")
Sleep(1000)
MouseMove(589,339)
MouseClick("left",589,339,2)
_read()
Send($var[1][0])
MouseMove(599,358)
MouseClick("left",599,358,2)
Send($var[1][1])
MouseMove(667,375)
MouseDown("left")
MouseUp("left")
Sleep(1000)


Func _read()
    $var = IniReadSection(@ScriptDir & "\test.ini", "UserPassword")
If @error Then MsgBox(4096, "", "Error occured, probably no INI file.")
EndFunc

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

argh Im so stupid... cant get this thing to work because I dont understand a thing about whats written in there =(

In 1 month Im gonna learn programming, but untill then im still a wannabee newb :(

If there is no ini file it will summon a WindowBox with a msg in it, I can read that...

it calls a file called test.ini and in there it will search for a section called

UserPassword and the thing behind it, he will put into the site to log in...

am i right?

anyways.. i dont need it to display a error or something if it fails.

all i want is the mouse to go to the input box on the website,

then it has to put in what i have written in the ini file

[userData]$UserName$=warbringer

$UserPassword$=12345

(Did i write the ini file correct???)

so 'in my newby non-programming' language it is:

MouseClick("left",589,339,2)
Send("IniRead ( "data.ini", "UserData", "$UserName$", "default" )")

can someone plz try to explain it in newb style for a real noob :think::)

Edited by Warbringer

Share this post


Link to post
Share on other sites

Got it working now thank you very very much!

Cheers

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Can someone plz help me 1 last time? :(:think:

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
Dim $var = 0
Run('C:\Program Files\Mozilla Firefox\firefox.exe')
WinWait("Mozilla Firefox Startpagina - Mozilla Firefox","")
If Not WinActive("Mozilla Firefox Startpagina - Mozilla Firefox","") Then WinActivate("Mozilla Firefox Startpagina - Mozilla Firefox","")
WinWaitActive("Mozilla Firefox Startpagina - Mozilla Firefox","")
MouseMove(259,71)
MouseDown("left")
MouseUp("left")
Sleep(1000)
Send("http{SHIFTDOWN};{SHIFTUP}//")
MouseMove(286,91)
MouseDown("left")
MouseUp("left")
Sleep(1000)
Run('C:\Program Files\Mozilla Firefox\firefox.exe')
WinWait("Mozilla Firefox Startpagina - Mozilla Firefox","")
If Not WinActive("Mozilla Firefox Startpagina - Mozilla Firefox","") Then WinActivate("Mozilla Firefox Startpagina - Mozilla Firefox","")
WinWaitActive("Mozilla Firefox Startpagina - Mozilla Firefox","")
MouseMove(308,75)
MouseDown("left")
MouseUp("left")
Sleep(1000)
Send("http{SHIFTDOWN};{SHIFTUP}//betacrime.be.funpic.de{ENTER}")
WinWait("BétàCrime - Mozilla Firefox","")
If Not WinActive("BétàCrime - Mozilla Firefox","") Then WinActivate("BétàCrime - Mozilla Firefox","")
WinWaitActive("BétàCrime - Mozilla Firefox","")
MouseMove(134,513)
MouseDown("left")
MouseUp("left")
Sleep(1000)
MouseMove(620,340)
MouseDown("left")
MouseUp("left")
Sleep(1000)
_read()
Send($var[1][0])
;Send("darkness")
MouseMove(602,359)
MouseDown("left")
MouseUp("left")
Sleep(1000)
Send("ffxiff")
MouseMove(668,383)
MouseDown("left")
MouseUp("left")
Sleep(1000)

Func _read()
    $var = IniReadSection(@ScriptDir & "\data.ini", "UserAccount")
If @error Then MsgBox(4096, "", "Error occured, probably no INI file.")
EndFunc

It wont fill in the UserAccount for some reason....

My .ini file looks like this

[userAccount]darkness

Best regards

Edited by Warbringer

Share this post


Link to post
Share on other sites

I figures it out, took me quite some time though lmao

var [1,1] instead of 1,0 hehe

Share this post


Link to post
Share on other sites

I figures it out, took me quite some time though lmao

var [1,1] instead of 1,0 hehe

HI,

:( it was already in my post above. You had the chance to copy it. :think:

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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