Jump to content

Force FileWriteLine() to write append to the bottom of the file


Recommended Posts

Is it possible? Here's my script so far;

;Includes
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
;Funcs
Func ScriptExit()
    $date = @MON & "/" & @MDAY & "/" & @YEAR
    $Line = "+-+-++-+-++-+-++-+-++-+-++-+-++-+-++-+-++-+-++-+-++-+-+" & "End:" & $date & "+-+-++-+-++-+-++-+-++-+-++-+-++-+-++-+-++-+-++-+-++-+-+"
    $FILE = FileOpen(@desktopdir&"\UberMM.txt",1)
    FileWriteLine($File, "-Closing Darkfall!")
    FileWriteLine($File, $Line)
    FileClose($File)
    MsgBox(64,"Ending","You successfully ended the macro!",2)
    Exit
EndFunc
HotKeySet("^!x", "ScriptExit")

;Vars
$winwake = WinExists("Darkfall Online");checking if Df is open

;Create GUI
$GUI= GuiCreate("Input window", 290, 150)
GUICtrlCreateLabel("Wonders uber MM macro!", 95, 10)
GUICtrlCreateLabel("MM:", 10, 33)
GUICtrlCreateLabel("Rest:", 10, 63)
GUICtrlCreateLabel("Amt:", 10, 93)
$Input_1 = GUICtrlCreateInput("",40,30,240,20)
$Input_2 = GUICtrlCreateInput("",40,60,240,20)
$Input_3 = GUICtrlCreateInput("",40,90,240,20)
$Run = GUICtrlCreateButton("Run it!", 80, 120, 140,30)
;Display GUI
GUISetState()

;Start Main loop
While 1

    Switch GuiGetMsg();Get activity from GUI
    Case $GUI_EVENT_CLOSE;Exit when X button is pressed
        MsgBox(0,"Closing","Saving your st00f. Program will terminate when you click OK.")
        Exit
        
    Case $Run;When saved is pressed
        $manamissile = GUICtrlRead($Input_1)
        $rest = GUICtrlRead($Input_2)
        $camt = GUICtrlRead($Input_3)
        $camtd = GUICtrlRead($Input_3)
        $date = @MON & "/" & @MDAY & "/" & @YEAR
        $Line = "+-+-++-+-++-+-++-+-++-+-++-+-++-+-++-+-++-+-++-+-++-+-+" & "Start:" & $date & "+-+-++-+-++-+-++-+-++-+-++-+-++-+-++-+-++-+-++-+-++-+-+"
        $FILE = FileOpen(@desktopdir&"\UberMM.txt",1)
        FileWriteLine($File, $Line)

        If $winwake = 0 then;If DF is open then it'll continue otherwise it'll close the macro.
            MsgBox(16,"Error!","It would appear that Darkfall is not running. Are you using h4x? Is your window renamed?! Wtf did you do?!")
            Exit
            
        Else
            MsgBox(64,"Starting","Ctrl+Alt+X to stop the macro!",2)
            WinActivate("Darkfall Online");Alt+tabbing into DF
            sleep(2000);Second sleep whilst we alt+tab in (Set it longer if your PC sucks!)
            FileWriteLine($File, "+Successfully alt+tabbed into Darkfall!")
            While 1;YAL (Yet another loop)
            
                If $camt = 0 then;This is the entire If for using rest
                    send("r")
                    sleep(1000)
                    send($rest);Press rest
                    sleep(1000)
                    MouseClick("left");Use rest
                    sleep(1000)
                    FileWriteLine($File, "+Resting")
                    MouseClick("right")
                    sleep(150000);Time it will spend resting (Alter this if it's too long//too short!)
                    MouseClick("right")
                    sleep(1000)
                    FileWriteLine($File, "-Resting")
                    send("w")
                    sleep(3000)
                    send("r")
                    sleep(2000)
                    send($manamissile);Press MM key
                    $camt = $camtd
                    
                Else;Use MM
                    MouseClick("left")
                    sleep(2000)
                    $camt -= 1
                    $MMLog = "+Casting Spell -" & $camt
                    FileWriteLine($File, $MMLog)
                    
                EndIf
                
            WEnd
            
        EndIf
        
        FileClose($File)
        
    EndSwitch
    
WEnd
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...