Jump to content

How do I read from a list?


lolp1
 Share

Recommended Posts

Ok, I've looked around and couldent find anything, so I decided to post. (Agian, I know...)

So I've been working on a Diablo II bot, and I was wondering how I could have it join games I list. Here is what I use now to join a game:

Func BnetJoin()

If $mode = "Bnet" then

$lobby = PixelGetColor(419,453)

While $lobby <> 525312

Sleep(50)

$lobby = PixelGetColor(419,453)

Wend

MyClick("left", 587, 491)

$opengame = PixelGetColor(458,146)

While $opengame <> 1580056

Sleep(50)

$opengame = PixelGetColor(458,146)

Wend

Sleep(100)

Send($gn)

Sleep(800)

Send("{TAB}")

Sleep(100)

Send($pw)

Sleep(1000)

As you can tell, I am just reading the game from a .ini.. This 'bot' is going to kill a certian boss (alot of them) and I'm looking for a way for the game to read from a list, instead of a hard and paintfull .ini. (it would be hard to list 100+ games in a .ini)

Thanks in advanced.

EDIT: also, it would need to perform the list in order, and it would help if after the task is done, to delete the last done game.:) Just need a point in the right direction. (Or maybe even some code snipets:)?)

Edited by lolp1
Link to comment
Share on other sites

HI,

so you want to have a list.txt with let say:

game1

game2

game3

and you want to read the list.

Try _FileReadToArray()

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

Link to comment
Share on other sites

Thats sort've correct yes. I searched for "FileReadToArray" in the help file and did not find anything.

Your idea is right though, except how would I get it to send the keys it reads? Andhow exzactly does the read function work?

Link to comment
Share on other sites

Hi,

then the func does exactly what you want. What version are you using?

#include <file.au3>
Dim $aRecords
If Not _FileReadToArray("error.log",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
For $x = 1 to $aRecords[0]
    Msgbox(0,'Record:' & $x, $aRecords[$x])
Next

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

Link to comment
Share on other sites

Hi,

post your complete source.

This part loops through the read data

For $x = 1 to $aRecords[0]

Msgbox(0,'Record:' & $x, $aRecords[$x])

Next

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

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