Jump to content

Simple Problem.


Recommended Posts

I forgot my anwser and question on one site xD so I build a quick thingy and got a quick thingy....

#include <File.au3>
HotKeySet("{F10}","Halt")
Dim $I,$F , $G = 0 , $True = 0 
FileOpen("G:\Cars.Txt",0)
$lines=_FileCountLines( "G:\Cars.Txt" )
For $I=1 to $lines  
    $Read = FileReadLine( "G:\Cars.Txt",$I)
    $Len = StringLen($Read)
        $FirstChar= StringLeft($Read,1)
        If $FirstChar ==StringUpper($FirstChar) Then
            $StringReplacedA=StringReplace( $Read , $FirstChar,StringLower($FirstChar))
            $True = 1 
        Else
            $True = 0
        EndIf
        if $G = 0 and $True = 1 Then
        MouseMove(340, 510)
        MouseClick("Left")
        Send($StringReplacedA)
        MouseMove(350,565)
        Sleep(5000)
        $G = 1 
    Else
            MouseMove(345, 610)
        MouseClick("Left")
        Send($StringReplacedA)
        MouseMove(345,635)
        MouseClick("Left")
        Sleep(5000)
        Endif
        
        $FirstChar= StringLeft($Read,1)
        If $FirstChar ==StringLower($FirstChar) Then
        $StringReplacedB=StringReplace( $Read , $FirstChar,StringUpper($FirstChar))
        $True = 1
            Else
            $True = 0
        EndIf
        if $G = 0 and $True = 1 Then
            MouseMove(340, 510)
        MouseClick("Left")
        Send($StringReplacedB)
        MouseMove(350,565)
        MouseClick("Left")
        Sleep(5000)
        $G = 1 
    Else
            MouseMove(345, 610)
        MouseClick("Left")
        Send($StringReplacedB)
        MouseMove(345,635)
        MouseClick("Left")
        Sleep(5000)
        Endif
            if $G = 0 Then
        MouseMove(340, 510)
        MouseClick("Left")
        Send($Read)
        MouseMove(350,565)
        Sleep(5000)
        $G = 1 
    Else
            MouseMove(345, 610)
        MouseClick("Left")
        Send($Read)
        MouseMove(345,635)
        MouseClick("Left")
        Sleep(5000)
        Endif
    Next
    Func Halt()
        while 1 
            Sleep(1)
        WEnd
        EndFunc

hope this is not illegal or sth :D

it works only once and then it basicly stops......I checked the lines in cars.txt its ok ...

Edited by Misha
Link to comment
Share on other sites

Now I don't know what your prog is supposed to do with all the mousemove's and mouseclick's,

but there is this :

FileOpen("C:/Cars.Txt",0)
$lines=_FileCountLines( "G:/Cars.Txt" )

Is Cars.txt on C:\ or on G:\ ?

and why do you use "/" instead of "\" ?

D2charkeeper = No more 'expired characters' in D2.File Date Changer = Change the file date(s), attributes and the filename case of multiple files @ once.Updater_full = Copy/Update your autoitscripts, pictures, .mp3, .avi etc ... subdirs from your PC to your memory stick or to your external harddisk. Now with scheduling and logging.Questmapper
Link to comment
Share on other sites

Guessing thats my problem :D

Well i fixed that but I still think it doesnt work..

This here is da error I get

G:\MiniBrute.au3 (50) : ==> Variable used without being declared.: 
Send($StringReplacedB) 
Send(^ ERROR
Edited by Misha
Link to comment
Share on other sites

;Added this line here
    Dim $StringReplacedB
    ;wihtout the above line if the next if statement is not true then $StringReplacedB will never be created and you will
    ;always get that erro messasge....you should initialize the variable $StringReplacedB to whatever you want in the line above
    
    $FirstChar= StringLeft($Read,1)
    If $FirstChar ==StringLower($FirstChar) Then
        $StringReplacedB=StringReplace( $Read , $FirstChar,StringUpper($FirstChar))
        $True = 1
    Else
        $True = 0
    EndIf
    if $G = 0 and $True = 1 Then
        MouseMove(340, 510)
        MouseClick("Left")
        Send($StringReplacedB)
        MouseMove(350,565)
        MouseClick("Left")
        Sleep(5000)
        $G = 1
    Else
        MouseMove(345, 610)
        MouseClick("Left")
        Send($StringReplacedB)
        MouseMove(345,635)
        MouseClick("Left")
        Sleep(5000)
    Endif

And your gonna have to do the same thing with StringReplacedA. Hope this helps.

_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Link to comment
Share on other sites

yea I did

$FirstChar= StringLeft($Read,1)
        If $FirstChar == StringLower($FirstChar) Then
        $StringReplacedB = StringReplace( $Read , $FirstChar,StringUpper($FirstChar))
        $TrueB = 1
            Else
            $TrueB = 0
        EndIf
    if $G == 0 and $TrueB == 1 Then
        MouseMove(340, 510)
        MouseClick("Left")
        Send($StringReplacedB)
        MouseMove(350,565)
        Sleep(5000)
        $G = 1 
    Else
            MouseMove(345, 610)
        MouseClick("Left")
        Send($StringReplacedB)
        MouseMove(345,635)
        MouseClick("Left")
        Sleep(5000)
        Endif

basicly cause I didnt want it to write empty msgs :\ but it gives me an error still about the varaible.

Link to comment
Share on other sites

;READ THESE COMMENTS AND USE THE Dim KEYWORK TO DECLARE THE VARIABLE LIKE THE NEXT LINE DOES
    Dim $StringReplacedB
    ;wihtout the above line if the next if statement is not true then $StringReplacedB will never be created and you will
    ;always get that erro messasge....you should initialize the variable $StringReplacedB to whatever you want in the line above
   
    $FirstChar= StringLeft($Read,1)
    If $FirstChar ==StringLower($FirstChar) Then
        $StringReplacedB=StringReplace( $Read , $FirstChar,StringUpper($FirstChar))
        $True = 1
    Else
        $True = 0
    EndIf
    if $G = 0 and $True = 1 Then
        MouseMove(340, 510)
        MouseClick("Left")
        Send($StringReplacedB)
        MouseMove(350,565)
        MouseClick("Left")
        Sleep(5000)
        $G = 1
    Else
        MouseMove(345, 610)
        MouseClick("Left")
        Send($StringReplacedB)
        MouseMove(345,635)
        MouseClick("Left")
        Sleep(5000)
    Endif

Look at the lines of comments with the line of code in the middle. Use it.

_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

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