Jump to content

Geeky

Active Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by Geeky

  1. Very nice! Although Pacman started acting weird at some point, it wouldn't "eat" the dots, and it went through walls :S
  2. This thread helped me and my friend a lot! We're currently working on a mIRC-like script, that allows several people to connect to one server and talk
  3. Ok, now i've spend a few hours on the script, and i can't find the damn error. My script looks like this now: #include <GUIConstants.au3> #include <array.au3> ; Create array of files to check for Global $aFileList[1] = [0] $file = FileOpen( "virusdb.txt", 0) Do $line = FileReadLine($file) If Not $line = "" Then _ArrayAdd($aFileList, "/lua/init/"& $line &".lua") EndIf Until $line = "" Global $sFoundList = "" GUICreate( "Gmod Virus-Killah", 400, 300) $path = GUICtrlCreateInput( "Path...", 30, 20, 250, 21) $browse = GUICtrlCreateButton( "Browse...", 300, 20, 70, 21) $results = GUICtrlCreateEdit("", 30, 60, 340, 200, $ES_READONLY) $Search = GUICtrlCreateButton( "Search & Destroy", 130, 270, 140, 21) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $browse $browsepath = FileSelectFolder( "Select your Gmod9 folder", "", 2) GUICtrlSetData($path, $browsepath) Case $msg = $Search GUICtrlSetData($results, "Scanning for lua viruses...", 1) $FolderPath = GUICtrlRead($path) For $n = 1 To UBound($aFileList) - 1 If FileExists($FolderPath & $aFileList[$n]) Then FileDelete($FolderPath & $aFileList[$n]) $FoundList = @CRLF & "Found and deleted: " & $FolderPath & $aFileList[$n] GUICtrlSetData($results, $FoundList) EndIf Next If $FoundList = "" Then GUICtrlSetData($results, "No virus found") GUICtrlSetData($results, @CRLF & "Placed antivirus log in lua/init", 1) $log = FileOpen($FolderPath & "\Antivirus_log.txt", 1) FileWriteLine($log, @CRLF & "---------------") FileWriteLine($log, @CRLF & "Antivirus Scan.") FileWriteLine($log, @CRLF & "---------------") FileWriteLine($log, @CRLF & "Scan Complete:") FileWriteLine($log, @CRLF & "Results:" & $FoundList) FileClose($log) EndSelect WEnd When i press the Search & Destroy button, it says that $Foundlist wasn't declared :S Anyone who can help me? (sorry for triple post )
  4. Whats the .default for? I'm not very experienced with autoit, but i'm pretty sure its not supposed to look like that. Whats the meaning of having the .default there?
  5. Okay, i've found a way (i think) to make updating the antivirus alot easier. Instead of having all the names in the script itself, i thought it would be better to have it in an external .txt document that everybody understands, and can add/remove viruses from. Now my question is; will this work? $file = FileOpen( "Virusdb.txt", 0) Global $aFileList[1] = [0] Do $line = FileReadLine($file) If Not $line = "" Then _ArrayAdd($aFileList, "/lua/init/" & $line) EndIf Until $line = "" Global $sFoundList = ""
  6. I've never used Arrays before, but i'll try and take a look at it. As far as i can see what i need to do to make the script you posted work like i wanted mine to do, i need to add all the names to arrays, like you started?
  7. I DID do what you told me, and it worked.
  8. My script worked before. I just found out why, I think i used FileFindFirstFile before, and thats why i made it like that. I'll try and change it back to see what happens. Thanks for the help
  9. Hi, there. I'm working an a small script to clean a half-life 2 mod folder, for "viruses". Unfortunately it doesn't work as i want it to Whenever i run it, it just says that it found and deleted all the viruses, even though the viruses doesn't exist, in the folder. Its a long one, but most of it is just copied and pasted The code: #include <GUIConstants.au3> GUICreate( "Gmod Virus-Killah", 400, 300) $path = GUICtrlCreateInput( "Path...", 30, 20, 250, 21) $browse = GUICtrlCreateButton( "Browse...", 300, 20, 70, 21) $results = GUICtrlCreateEdit( "", 30, 60, 340, 200, $ES_READONLY) $Search = GUICtrlCreateButton( "Search & Destroy", 130, 270, 140, 21) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $browse $browsepath = FileSelectFolder( "Select your Gmod9 folder", "", 2) GUICtrlSetData($path, $browsepath) Case $msg = $Search GUICtrlSetData ($results, "Scanning for lua viruses...",1) $1 = FileExists( $path &"/lua/init/ULM.lua") If $1 = "ULM.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: ULM.lua",1) FileDelete($path &"/lua/init/ULM.lua") EndIf $2 = FileExists( $path &"/lua/init/UFM.lua") If $2 = "UFM.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: UFM.lua",1) FileDelete($path &"/lua/init/UFM.lua") EndIf $3 = FileExists( $path &"/lua/init/UCM.lua") If $3 = "UCM.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: UCM.lua",1) FileDelete($path &"/lua/init/UCM.lua") EndIf $4 = FileExists( $path &"/lua/init/UEM.lua") If $4 = "UEM.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: UEM.lua",1) FileDelete($path &"/lua/init/UEM.lua") EndIf $5 = FileExists( $path &"/lua/init/USM.lua") If $5 = "USM.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: USM.lua",1) FileDelete($path &"/lua/init/USM.lua") EndIf $6 = FileExists( $path &"/lua/init/URM.lua") If $6 = "URM.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: URM.lua",1) FileDelete($path &"/lua/init/URM.lua") EndIf $7 = FileExists( $path &"/lua/init/UNM.lua") If $7 = "UNM.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: UNM.lua",1) FileDelete($path &"/lua/init/UNM.lua") EndIf $8 = FileExists( $path &"/lua/init/UPM.lua") If $8 = "UPM.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: UPM.lua",1) FileDelete($path &"/lua/init/UPM.lua") EndIf $9 = FileExists( $path &"/lua/init/ah.lua") If $9 = "ah.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: ah.lua",1) FileDelete($path &"/lua/init/ah.lua") EndIf $10 = FileExists( $path &"/lua/init/ERAT.lua") If $10 = "ERAT.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: ERAT.lua",1) FileDelete($path &"/lua/init/ERAT.lua") EndIf $11 = FileExists( $path &"/lua/init/oma2r3fxc6g.lua") If $11 = "om2r3fxc6g.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: oma2r3fxc6g.lua",1) FileDelete($path &"/lua/init/oma2r3fxc6g.lua") EndIf $12 = FileExists( $path &"/lua/init/racehook*.lua") If $12 = "racehook.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: racehook#.lua",1) FileDelete($path &"/lua/init/racehook#.lua") EndIf $13 = FileExists( $path &"/lua/init/racehook3.lua") If $13 = "racehook3.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: racehook3.lua",1) FileDelete($path &"/lua/init/racehook3.lua") EndIf $14 = FileExists( $path &"/lua/init/Z.lua") If $14 = "Z.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: Z.lua",1) FileDelete($path &"/lua/init/Z.lua") EndIf $15 = FileExists( $path &"/lua/init/urn.lua") If $15 = "urn.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: urn.lua",1) FileDelete($path &"/lua/init/urn.lua") EndIf $16 = FileExists( $path &"/lua/init/initialize.lua") If $16 = "initialize.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: initialize.lua",1) FileDelete($path &"/lua/init/initialize.lua") EndIf $17 = FileExists( $path &"/lua/init/luaupdate10.lua") If $17 = "luaupdate10.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: luaupdate10.lua",1) FileDelete($path &"/lua/init/luaupdate.lua") EndIf $18 = FileExists( $path &"/lua/init/makecode.lua") If $18 = "makecode.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: makecode.lua",1) FileDelete($path &"/lua/init/makecode.lua") EndIf $19 = FileExists( $path &"/lua/init/omgwtfbbq.lua") If $19 = "omgwtfbbq.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: omgwtfbbq.lua",1) FileDelete($path &"/lua/init/wtfbbq.lua") EndIf $20 = FileExists( $path &"/lua/init/GMXinit.lua") If $20 = "GMXinit.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: gmxinit.lua",1) FileDelete($path &"/lua/init/gmxinit.lua") EndIf $21 = FileExists( $path &"/lua/init/test.lua") If $21 = "test.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: test.lua",1) FileDelete($path &"/lua/init/test.lua") EndIf $22 = FileExists( $path &"/lua/init/vmfloaderclient.lua") If $22 = "vmfloaderclient.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: vmfloaderclient.lua",1) FileDelete($path &"/lua/init/vmfloaderclient.lua") EndIf $23 = FileExists( $path &"/lua/init/ulxboost.lua") If $23 = "ulxboost.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: ulxboost.lua",1) FileDelete($path &"/lua/init/ulxboost.lua") EndIf $24 = FileExists( $path &"/lua/init/antivirus_update.lua") If $24 = "antivirus_update.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: antivirus_update.lua",1) FileDelete($path &"/lua/init/antivirus_update.lua") EndIf $25 = FileExists( $path &"/lua/init/ULM2.lua") If $25 = "ULM2.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: ULM2.lua",1) FileDelete($path &"/lua/init/ULM2.lua") EndIf $26 = FileExists( $path &"/lua/init/zzz.lua") If $26 = "zzz.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: zzz.lua",1) FileDelete($path &"/lua/init/zzz.lua") EndIf $27 = FileExists( $path &"/lua/init/lw.lua") If $27 = "lw.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: lw.lua",1) FileDelete($path &"/lua/init/lw.lua") EndIf $28 = FileExists( $path &"/lua/init/lw_2.lua") If $28 = "lw_2.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: lw_2.lua",1) FileDelete($path &"/lua/init/lw_2.lua") EndIf $29 = FileExists( $path &"/lua/init/spoon.lua") If $29 = "spoon.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: spoon.lua",1) FileDelete($path &"/lua/init/spoon.lua") EndIf $30 = FileExists( $path &"/lua/init/teaspoon.lua") If $30 = "teaspoon.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: teaspoon.lua",1) FileDelete($path &"/lua/init/teaspoon.lua") EndIf $31 = FileExists( $path &"/lua/init/Facehook.lua") If $31 = "Facehook.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: facehook.lua",1) FileDelete($path &"/lua/init/facehook.lua") EndIf $32 = FileExists( $path &"/lua/init/vtfplugin.lua") If $32 = "vtfplugin.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: vtfplugin.lua",1) FileDelete($path &"/lua/init/vtfplugin.lua") Filedelete( $path &"") EndIf $33 = FileExists( $path &"/lua/init/gm_hockeywrite.lua") If $33 = "gm_hockeywrite.lua" Then GUICtrlSetData ($results, @CRLF &"Found and deleted: gm_hockeywrite.lua",1) FileDelete($path &"/lua/init/gm_hockeywrite.lua") EndIf If $1 and $2 and $3 and $4 and $5 and $6 and $7 and $8 and $9 and $10 and $11 and $12 and $13 and $14 and $15 and $16 and $17 and $18 and $19 and $20 and $21 and $22 and $23 and $24 and $25 and $26 and $27 and $28 and $29 and $30 and $31 and $32 and $33 = -1 Then GUICtrlSetData ($results, "No virus found") EndIf GUICtrlSetData ($results, @CRLF &"Placed antivirus log in lua/init", 1) $log = FileOpen( $path &"\Antivirus_log.txt", 1) FileWriteLine( $path &"\Antivirus_log.txt", @CRLF & "---------------") FileWriteLine( $path &"\Antivirus_log.txt", @CRLF & "Antivirus Scan.") FileWriteLine( $path &"\Antivirus_log.txt", @CRLF & "---------------") FileWriteLine( $path &"\Antivirus_log.txt", @CRLF & "Scan Complete:") FileWriteLine( $path &"\Antivirus_log.txt", @CRLF & "Results:" & $results) FileClose($log) EndSelect If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Thank you.
  10. D'oh. I have Beta but i forgot to select the beta as my helpfile (put the helpfile in my startmemi shortcuts)
  11. Looked through the forums, and i found the function FileFindFirstFile, and the FIleFindNextFIle and i think im just gonna use that. Thanks for your help.
  12. Can't find anything with _FileListToArray, only _FileREADtoArray. Is it because my helpfile is old, or?
  13. I don't know if any of you knows Gmod ( a half-life 2 modification). But im working on a script that will make spawnmenus just by the press of a button, what i want it to do is to list all the filenames from a folder with the .mdl extension. Is there a way to make it list all files? I'll figure out the part with the .mdl myself. Is there already a function to do it? or do i have to make it in some other way?
  14. Thanks alot Thatsgreat2345, only thing is, that im using checkboxes, bu that shouldnt be too hard to change, else ill let you know ^^ There, changed it, thanks again, will make installing mods alot easier ^^
  15. Sorry, my fault #include <GUIConstants.au3> #NoTrayIcon GUICreate ( "Mod Installer" , 400 , 200 , -1 , -1 ) GUISetState(@SW_SHOW) GUISetBKColor (0x5a7cba) GUICtrlCreateLabel( "What mods do you want to install?", 10, 5, 400, 20) GUICtrlCreateLabel( "Select directory to install to. Usually SteamApps/SourceMods/Gmod9/mods/", 10, 105, 400, 20) $cb1 = GUICtrlCreateCheckbox ("PHX Models Pack 2", 10, 20, 120, 20) $cb2 = GUICtrlCreateCheckbox ("Baj's Custom entities", 10, 40, 120, 20) $cb3 = GUICtrlCreateCheckbox ("Gmod Plus", 10, 60, 120, 20) $checkcb1 = GUICtrlRead($cb1) $checkcb2 = GUICtrlRead($cb2) $checkcb3 = GUICtrlRead($cb3) $dest = FileSelectFolder("Select directory to install to. Usually SteamApps/SourceMods/Gmod9/mods/", "", 1) $button = GUICtrlCreateButton ("Install", 300, 170, 90, 22) $browse = GUICtrlCreateButton ("Browse", 200, 170, 90, 22) GUICtrlCreateLabel( $dest, 30, 140, 350, 20) $1 = 0 $2 = 0 $3 = 0 GUICtrlCreateGroup ("Directory", 20, 125, 365, 40) While 1 $msg = GUIGetMsg() Select Case $msg = $browse $dest = FileSelectFolder("Select directory to install to. Usually SteamApps/SourceMods/Gmod9/mods/", "", 1) $msg = 0 EndSelect Select Case $msg = $button MsgBox( 0, "Info", "Gmod9 Mods Installer will now install the selected mods and rebuild the Modcache, this may take a while") If $dest = "" Then MsgBox( 1, "Error", "You have to select a folder") EndIf $msg = 0 if $checkcb1 = $GUI_CHECKED Then DirCopy( "files/Phoenix_storms_MP2", $dest & "\Phoenix_storms_MP2", 1) DirCopy( "files/PhoeniX_icons", $dest & "\PhoeniX_icons", 1) DirCopy( "files/PhoeniX_icons", $dest & "\-modcache", 1) DirCopy( "files/Phoenix_storms_MP2", $dest & "\-modcache", 1) EndIf if $checkcb2 = $GUI_CHECKED Then DirCopy( "files/Custom_Entities", $dest & "\Custom_Entities", 1) DirCopy( "files/Custom_Entities", $dest & "\-modcache", 1) EndIf if $checkcb3 = $GUI_CHECKED Then DirCopy( "files/GmodPlus", $dest & "\GmodPlus", 1) DirCopy( "files/GmodPlus", $dest & "\-modcache", 1) EndIf MsgBox( 0, "Info", "Installation succesful") ExitLoop EndSelect If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend
  16. That screenshot looks pretty bad Nfwu, but the window in the upper left corner saying: "Analysis report: You're pregnant" I pretty funny
  17. I recently started experimenting with GUI's and i can't believe how i ever lived without it ^^ Well, the thing is that i've made a button in a GUI that has to be pushable many times, its for selecting an install path. Problem is, that it only works once The only reason i can come up with is that after Case $msg = $button $msg is still $button I've searched the forums for 2 hours now, searching for buttons, button event, button presses and so on. Anyone who can help me?
  18. My problem with these buttons is that they only work once :S
  19. Im not sure, but maybe something with that $readinput = GUICtrlRead($INputBoxNameHere) If $readinput = "" Then Msgbox( 1, "Error", "The inputbox is empty! Oh noeses!") Not sure how to use that guictrlread thingy though
  20. Im feeling very stupid right now...
  21. I've got this script for moving files from one folder to another, and i wanted to know how i can make a script that checks what files are checked, and if they are, then move it to the right directory. But it keeps saying that there is Endselect but not Select, why? GUICreate ( "Checkbox" , 300 , 200 , -1 , -1 ) GUISetBKColor (0xFFFFAA) $cb1 = GUICtrlCreateCheckbox ("CHECKBOX 1", 10, 10, 120, 20) $cb2 = GUICtrlCreateCheckbox ("CHECKBOX 2", 10, 40, 120, 20) $button = GUICtrlCreateButton ("Check", 60, 80, 200, 20) While 1 $msg = GUIGetMsg() Select case $msg = $button If $cb2 = $GUI_CHECKED Then DirCopy("1", "dest", 1) If $cb1 = $GUI_CHECKED Then DirCopy("2", "dest", 1) Endselect If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend
  22. Thx, couldn't find anything about it in the help file
  23. You mean like Press Right mouse button Press left mouse button wait Press Right mouse button Press left mouse button wait Press Right mouse button Press left mouse button wait and so on... Or?
  24. I've made a small and simple calculator, for calculating circles. But then i want it to send the results its ends up in one big number $radius = inputbox( "Circle's Radius", "Type the circle you want to calculate's RADIUS in cm(Centimetres) here:", "", "", 150, 150) $diameter = $radius + $radius $Area = $radius * $radius * 3.14 $Perimeter = $diameter * 3.14 $Calculations = ($diameter & $area & $perimeter) MsgBox ( 0, "Calculations", $calculations) How do i put one result on each line? MsgBox Diameter: 3476 Area: 2937 Perimeter: 3872 OK
  25. Hi, Ive made a script to search for a special color, but it wont do what i want it to do when it finds the color... I tried to fill the whole background in paint with the color (Light Green) But it still wont react, whats the problem?? $tid = inputbox( "Checkbox tid", "How long should Checkbox run (Hours)?", "24",) $checkbox = $tid * 6 * 60 $o = 1 $o = $o + 1 Do $coord = PixelSearch( 157, 170, 567, 537, 0x00ff00, 30) $color = PixelGetColor( "$coord[0]", "$coord[1]") If $color = ("0x00ff00") Then MouseMove ( "$coord[0]", "$coord[1]") MouseClick ("left", "$coord[0]", "$coord[1]") Until $o = $checkbox
×
×
  • Create New...