ArK112 Posted June 15, 2015 Share Posted June 15, 2015 (edited) Hey i want to make my script repeat every 30 sec, i'm really new to scripting and i didn't read the Help files.I'm using my script for auto saving (right now i need to manualy do it) a server i host.;---------start this script------------------If ProcessExists("Aplication.exe") ThenWinActivate("RoAG Romanian Army Group")Send("save{ENTER}")EndIf;----------end this script-------------------- Edited June 15, 2015 by ArK112 Link to comment Share on other sites More sharing options...
water Posted June 15, 2015 Share Posted June 15, 2015 Welcome to Autoit and the forum!What is "RoAG Romanian Army Group"? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Scripthen Posted June 15, 2015 Share Posted June 15, 2015 It's a clan on an FPS game. Link to comment Share on other sites More sharing options...
water Posted June 15, 2015 Share Posted June 15, 2015 ArK112,seems you missed to read the forum rules on your way in.Please do so now. You will see that any kind of game automation is not allowed on this forum. THat's way you will not get any help on this subject. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
ArK112 Posted June 15, 2015 Author Share Posted June 15, 2015 (edited) ArK112,seems you missed to read the forum rules on your way in.Please do so now. You will see that any kind of game automation is not allowed on this forum. THat's way you will not get any help on this subject.But it not a game automation it's a server automation, it's this still not ok? That's just the name of the server, there's nothing to do about with any type of game! Edited June 15, 2015 by ArK112 Link to comment Share on other sites More sharing options...
Scripthen Posted June 15, 2015 Share Posted June 15, 2015 (edited) Minecraft server? However, you'll need to find the process name.If started by CMD it'll be something like: " cmd.exe *parameters*"if the {enter} doesn't work, try {numpadenter} I had trouble with {enter} so I tried {numpadenter} and it worked just fine. As for the 30 seconds, add the code in to the While 1 loop and use Sleep. Examples below.Sleep(30000)Send("save-all")Send("{NUMPADENTER}")Sleep(2000) Edited June 15, 2015 by Scripthen Misread. Link to comment Share on other sites More sharing options...
water Posted June 15, 2015 Share Posted June 15, 2015 But why would a server display a window titled "RoAG Romanian Army Group"?What application do you try to automate? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted June 15, 2015 Share Posted June 15, 2015 (edited) You should go read the help files, asking for help without taking the time to try and help yourself is not the best way.As far as repeating a simple script you're going to need a loop.While 1 ;Start Loop If ProcessExists("Aplication.exe") Then WinActivate("RoAG Romanian Army Group") Send("save{ENTER}") Else ;If Process does not exist ExitLoop ;Exit the Loop EndIf Sleep(30000) ;sleep 30 seconds WEnd ;Close LoopAlso the Function AdlibRegister() would work well for you.https://www.autoitscript.com/autoit3/docs/functions/AdlibRegister.htmI personally do not get involved with the politics on the board, but just be aware there are strictly enforced rules about "game automation" but somebody did get a "OK" from the mods the other day for the same kind of request about automating a server. Regards, Edited June 15, 2015 by ViciousXUSMC Link to comment Share on other sites More sharing options...
ArK112 Posted June 15, 2015 Author Share Posted June 15, 2015 It's a CMD window, the RoAG Romanian Army Group is the name of the server. The script is working, i did a exe out of it, when i'm runing the exe it's writing in the CMD window "save" and the it press "Enter" (Server was saved succesfully).I just want to make this auto so i don't need to always run the exe manualy. Link to comment Share on other sites More sharing options...
Scripthen Posted June 15, 2015 Share Posted June 15, 2015 You should go read the help files, asking for help without taking the time to try and help yourself is not the best way.As far as repeating a simple script you're going to need a loop.<code>While 1 ;Start LoopIf ProcessExists("Aplication.exe") ThenWinActivate("RoAG Romanian Army Group")Send("save{ENTER}")Else ;If Process does not existExitLoop ;Exit the Loop EndIfSleep(30000) ;sleep 30 secondsWEnd ;Close Loop</code> Also the Function AdlibRegister() would work well for you.https://www.autoitscript.com/autoit3/docs/functions/AdlibRegister.htmI personally do not get involved with the politics on the board, but just be aware there are strictly enforced rules about "game automation" Regards,Quick question. Will it violate the Game Automation Rule is it's a game server console? Technically, it's not a game, just code and a cmd window. Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted June 15, 2015 Share Posted June 15, 2015 Thats not for me to say, this is not my forum I do moderate a forum however (Widescreen Gaming Forum) so I know as a member I would need to respect however the mods choose to run their own forum here. Link to comment Share on other sites More sharing options...
water Posted June 15, 2015 Share Posted June 15, 2015 I have already reported this thread. So a Mod will chime in and tell us what he thinks about this subject. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
ArK112 Posted June 15, 2015 Author Share Posted June 15, 2015 (edited) ViciousXUSMC thx for the code looks like it's working (sorry for not reading the help files)Is there a any way that when the script is running>writing in the CMD "save">hitting enter to do this in the background (i don't think this is possible but still)?Right now at every 30 sec the window with the CMD is poping out and i need to minimize it every time. Edited June 15, 2015 by ArK112 Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted June 15, 2015 Share Posted June 15, 2015 This is where you should start researching "autoit minimize cmd window" there are a few ways to do it.Since you're sending keys the window will have to come up, and then be minimized after. So you should search for "autoit minimize window" and I am sure you will ultimatly come across: https://www.autoitscript.com/autoit3/docs/functions/WinSetState.htm Link to comment Share on other sites More sharing options...
Scripthen Posted June 15, 2015 Share Posted June 15, 2015 Yes WinSetState or you can also use Send() command with Keyboard Short-cuts. Link to comment Share on other sites More sharing options...
ArK112 Posted June 15, 2015 Author Share Posted June 15, 2015 ViciousXUSMC did it. The action is still going to interrupt me from other actions but it's a little better then before. Link to comment Share on other sites More sharing options...
Scripthen Posted June 15, 2015 Share Posted June 15, 2015 ViciousXUSMC did it. The action is still going to interrupt me from other actions but it's a little better then before.Yes, because Autoit is just automation so it's how you would do it, just sped up. Really the only way to properly communicate with a program is to rewrite or add to the main program in it's native language. Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted June 15, 2015 Share Posted June 15, 2015 Its also why its best to run a server, on a server a machine you do not use as your personal computer.If you can find a cmd to do your task you can use @ComSpec and have a hidden CMD window, but it sounds like your interacting with a console not opening a fresh blank CMD window.Its up to you to find how you can interact with the server and then have Autoit help you with it. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 15, 2015 Moderators Share Posted June 15, 2015 ArK112,Welcome to the AutoIt forums.This is another of those threads that make Mods go grey early - although for both Jos and myself it is already too late! Although technical "game server interaction" it is, just like the other thread referred to above a simple automation of a CMD window - so I am leaving it open, but please read the Forum rules to make sure you understand where the boundaries of this forum are quite clearly set.M23P.S. I wish new members would read the Forum rules before posting - asking the same question without the overt game reference would have saved a lot of time and effort for several people. Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now