How can I move the first line ( username1|password1 ) to another txt file and make the second line (username2|password2) the first line.
so it will be something like this
and then I need to be able to split the username and password, so that I can use it to log in.
so that I get something like this:
$user = username1
$pass = password1
Wow, that's one of the most basic things in AutoIt...
Code:
#include <File.au3>
#include <Array.au3>
;Get Usernames and Passwords.
;~ Local $aSplittenFile[_FileCountLines("file1.txt")]
;~ For $i = 0 To UBound($aSplittenFile) - 1
;~ $aSplittenFile[$i] = FileReadLine("file1.txt", $i + 1)
;~ Next
;~ Local $aSplits[UBound($aSplittenFile)][2]
;~ For $i = 0 To UBound($aSplittenFile) - 1
;~ $aTmp = StringSplit($aSplittenFile[$i], "|", 2)
;~ $aSplits[$i][0] = $aTmp[0]
;~ $aSplits[$i][1] = $aTmp[1]
;~ Next
_ArrayDisplay($aSplits)
;Delete first line and move it to the 2nd file.
;~ $sFile = FileReadLine("file1.txt", 1)
;~ _FileWriteToLine("file1.txt", 1, "", 1)
;~ FileWrite("file2.txt", $sFile)
Thanks a lot!
But by getting the username and password I ment that I could let the bot enter the username and password in the game.
with: Send or something
And not show them in ArrayDisplay.
also; is it possibe to only let it do the action when file2 is empty?
sorry if I wasn't clear , my english isn't good :-(
_ArrayDisplay was just there for debugging purposes and showing how they are listed.
Yes you can enter that in a game, simply focus the box where you want to put it in and either use ControlSend or Send.
Yes it is, you can do
Code:
If Not FileGetSize("file2.txt") Then ;file is empty.
_ArrayDisplay was just there for debugging purposes and showing how they are listed.
Yes you can enter that in a game, simply focus the box where you want to put it in and either use ControlSend or Send.
Yes it is, you can do
Code:
If Not FileGetSize("file2.txt") Then ;file is empty.
Now I get it I think:
$aTmp[0] = the username
$aTmp[1] = the password
Works fine for now, Gonna see if it works in the bot tommorow.
no offence but if you cant do simple file read / string split... your bot is gonna suck ***. im not saying im pro , ofcourse i was there years ago too in the ultra-beginner gear, ofcourse im not saying quit... il say... KEEP GOING ! but you MUST try do it yourself ! atleast try trial & error until your head blows up into million pieces and u have no other way but to come here and ask for help !
no offence but if you cant do simple file read / string split... your bot is gonna suck ***. im not saying im pro , ofcourse i was there years ago too in the ultra-beginner gear, ofcourse im not saying quit... il say... KEEP GOING ! but you MUST try do it yourself ! atleast try trial & error until your head blows up into million pieces and u have no other way but to come here and ask for help !
but best of luck !
I know I suck xD
But all the bot needs is auto login,config, and image detection using ImageSearch. all of them are really easy... The only part I couldnt' do myself is the auto login.
And It's for personal use, so I don't care if it isn't 100% stable.
But still I hope it's gonna be stable, made a smaller bot with same things in it already and it never crashed so far.
[Poll] Reading data from text file or database? 04/01/2011 - SRO Coding Corner - 11 Replies Hi,
I'm currently facing a little choice about how I should read the data of silkroad. So I hope that I can get a clear answer with this thread/poll.
Well as you might know I'm using C++ and currently I'm reading the data into the memory which is just a big list of for example npc position objects.
So yesterday I created a little test and I inserted all the npc positions into an MySQL database (version 5.1) and I used 10 different id's of npcs to get the positions. I runned this test...