Jump to content
Sign in to follow this  
au3scr

Logonbot errors

Recommended Posts

Hi, i am making logon bot dor Diablo II...

When i added there file check,It dont start. it drops me errors.

Whats wrong here?

problem is before func d2logon ()

So i need to make it check if script is same directori as diablo

if it is then use d2logon()

if not, then copy logonbot.exe and account.txt into diablo II directory

$readpath = FileReadLine ("account.txt",4)
$readdir = FileReadLine ("account.txt",5)
$exist = FileExists(@ScriptDir&"\Diablo II.exe")
If $exist = 1 Then 
    d2logon ()
Else    
FileCopy(@ScriptDir&"\account.txt",$readdir)
FileCopy(@ScriptDir&"\logonbot.exe",$readdir)
Else
func d2logon ()
run($readpath&" -w -title Diablo")
WinWaitActive("Diablo")
send("sss")
sleep(500)
send("sss")
sleep(500)
send("sss")
sleep(1500)
send('{enter 3}')
WinMove("Diablo","",0,0,800,600)
sleep(1000)
Mousemove(394,430,128)
sleep(500)
MouseClick("left",394,430,1,1)
WinWaitActive("Diablo")
MouseClick("left",394,330,1,1)
sleep(1500)
MouseClick("left",394,365,1,1)
Send("^a")
send('{backspace}')
$readusr = FileReadLine ("account.txt",1)
send($readusr)
sleep(500)
send('{tab}')
sleep(200)
$readusrpw = FileReadLine ("account.txt",2)
send($readusrpw)
sleep(200)
send('{enter}')
sleep(1000)
$readusrspot = FileReadLine ("account.txt",3)
if $readusrspot = 1 Then
    MouseClick("left",211,174,1,1)
Else
    if $readusrspot = 2 Then
    MouseClick("left",415,164,1,1)
    Else
    if $readusrspot = 3 Then
    MouseClick("left",229,257,1,1)
    Else
    if $readusrspot = 4 Then
    MouseClick("left",415,253,1,1)
    Else
    if $readusrspot = 5 Then
    MouseClick("left",177,341,1,1)
    Else
    if $readusrspot = 6 Then
    MouseClick("left",408,341,1,1)
    Else
    if $readusrspot = 7 Then
    MouseClick("left",161,427,1,1)
    Else
    if $readusrspot = 8 Then
    MouseClick("left",438,431,1,1)
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
EndFunc

Account.txt

Account
Password
1
C:\Program Files\Diablo II\Diablo II.exe
C:\Program Files\Diablo II\
Edited by au3scr

Share this post


Link to post
Share on other sites

Missing an Endif before your function...

$readpath = FileReadLine ("account.txt",4)
$readdir = FileReadLine ("account.txt",5)
$exist = FileExists(@ScriptDir&"\Diablo II.exe")
If $exist = 1 Then 
    d2logon ()
Else    
FileCopy(@ScriptDir&"\account.txt",$readdir)
FileCopy(@ScriptDir&"\logonbot.exe",$readdir)
EndIf
func d2logon ()
run($readpath&" -w -title Diablo")
WinWaitActive("Diablo")
send("sss")
sleep(500)
send("sss")
sleep(500)
send("sss")
sleep(1500)
send('{enter 3}')
WinMove("Diablo","",0,0,800,600)
sleep(1000)
Mousemove(394,430,128)
sleep(500)
MouseClick("left",394,430,1,1)
WinWaitActive("Diablo")
MouseClick("left",394,330,1,1)
sleep(1500)
MouseClick("left",394,365,1,1)
Send("^a")
send('{backspace}')
$readusr = FileReadLine ("account.txt",1)
send($readusr)
sleep(500)
send('{tab}')
sleep(200)
$readusrpw = FileReadLine ("account.txt",2)
send($readusrpw)
sleep(200)
send('{enter}')
sleep(1000)
$readusrspot = FileReadLine ("account.txt",3)
if $readusrspot = 1 Then
    MouseClick("left",211,174,1,1)
Else
    if $readusrspot = 2 Then
    MouseClick("left",415,164,1,1)
    Else
    if $readusrspot = 3 Then
    MouseClick("left",229,257,1,1)
    Else
    if $readusrspot = 4 Then
    MouseClick("left",415,253,1,1)
    Else
    if $readusrspot = 5 Then
    MouseClick("left",177,341,1,1)
    Else
    if $readusrspot = 6 Then
    MouseClick("left",408,341,1,1)
    Else
    if $readusrspot = 7 Then
    MouseClick("left",161,427,1,1)
    Else
    if $readusrspot = 8 Then
    MouseClick("left",438,431,1,1)
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
EndFunc

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  

×
×
  • Create New...