FrankFamily Posted August 6, 2012 Share Posted August 6, 2012 (edited) I want to make a script dragon plugin that runs a console command each 10 minutes, is this code right? (i don't know much, i've learned all i know about programming today :)things between ** are not in the code. **THIS THINGS WERE IN THE DUMMY**#include "common\skyscript.h"#include "common\obscript.h"#include "common\types.h"#include "common\enums.h"#include "common\plugin.h" **The config file**#define CONFIG_FILE "PCBoosterConfig.ini" void Boost(){ PrintNote("Skyrim Boosted"); **a notification** ExecuteConsoleCommand( "pcb", NULL ) **the console command that runs** while (TRUE) { Wait(0); }} void main(){ int timer = IniReadInt( CONFIG_FILE, "Settings", "interval", 600000 ); Boost(); while (true) { Boost(); wait(interval); }} The config file has the following: [settings]interval=600000 Will this make pcb run each 600000ms = 10 mins??If it's bad or there is another better way to do it, or something is missing, please tell me. Edited August 6, 2012 by FrankFamily Link to comment Share on other sites More sharing options...
FrankFamily Posted August 9, 2012 Author Share Posted August 9, 2012 UDPATE:--------------- This is my code at the moment:--------------------------------------------------------------------------------------------------------------------------------/*PCBooster SCRIPTThis file is property of FrankFamily*/ #include "common\skyscript.h"#include "common\obscript.h"#include "common\types.h"#include "common\enums.h"#include "common\plugin.h" #define CONFIG_FILE "PCBoosterConfig.ini"#define SCR_NAME "PCBooster" void Boost(){PrintNote("Skyrim Boosted");ExecuteConsoleCommand( "pcb", NULL )while (true){Wait(0);}} void main(){int timer = IniReadInt( CONFIG_FILE, "Settings", "interval", 600000 ); Boost(); while (true) {Boost();wait(timer);}}-------------------------------------------------------------------------------------------------------------------------------- and the config file (PCBoosterConfig.ini) has the following: ;=========================; PCBooster for Skyrim; by FrankFamily 2012;=========================[settings]:Interval between one boost and the next in milliseconds (ms) so 1 minute = 60000. 10 mins by default.interval=600000 -------------------------------------------------------------------------------------------------------------------------------- But recieve this message when i try to build solution: 1>------ Build started: Project: PCBooster, Configuration: main Win32 ------1> PCBooster.cpp1>PCBooster.cpp(19): error C2143: syntax error : missing ';' before 'while'1>PCBooster.cpp(33): error C3861: 'wait': identifier not found========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== So what would be the right code, or a better way to do it, and how to make configurable the display? Any help is appreciated.Thanks in advance.FrankFamily Link to comment Share on other sites More sharing options...
Recommended Posts