shadowrecon Posted February 4, 2012 Share Posted February 4, 2012 (edited) So im trying to add a function to my script when it starts if smart isnt enabled and it is defined, it will writeln a statement until smart is enabled. so far what im doing is not working. Heres what i have {$IFNDEF SMART} while Not(SmartEnabled) do begin Writeln('Please Enable Smart...'); Wait(1000); end; cleardebug; {$ENDIF}[/Code] Edited February 4, 2012 by shadowrecon Quote Link to comment Share on other sites More sharing options...
Wanted Posted February 4, 2012 Share Posted February 4, 2012 program New; {$DEFINE RS2} {$DEFINE OSI_Color_Anti_Randoms} //{$DEFINE SMART} // Comment out to disable SMART {$I OSI\OSI.scar} procedure ScriptTerminate; begin FreeOSI; end; begin SetUpOSI; {$IFNDEF SMART} WriteLn('Smart disabled'); {$ENDIF} end. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted February 4, 2012 Author Share Posted February 4, 2012 program New; {$DEFINE RS2} {$DEFINE OSI_Color_Anti_Randoms} //{$DEFINE SMART} // Comment out to disable SMART {$I OSI\OSI.scar} procedure ScriptTerminate; begin FreeOSI; end; begin SetUpOSI; {$IFNDEF SMART} WriteLn('Smart disabled'); {$ENDIF} end. what im trying to do is delay the script until smart has been 'enabled' i can use this which waits until smart is enabled while Not(SmartEnabled) do begin Writeln('Please Enable Smart...'); Wait(1000); end; cleardebug; but i dont want it to check if smart is enabled if smart is not defined, make since? Quote Link to comment Share on other sites More sharing options...
Wanted Posted February 4, 2012 Share Posted February 4, 2012 what im trying to do is delay the script until smart has been 'enabled' i can use this which waits until smart is enabled while Not(SmartEnabled) do begin Writeln('Please Enable Smart...'); Wait(1000); end; cleardebug; but i dont want it to check if smart is enabled if smart is not defined, make since? What you are trying to do is not possible, at least not with practically with OSI. In order to use SMART at all using OSI's implantation you must define it which overrides all mouse/color routines. If you really wanted to you could not define SMART, still use OSI.. make all of your own custom functions that are found in smart.scar that use a boolean to use the smart function or revert to the normal one. Seems like a lot of work to do something that is pretty pointless. You definitely wouldn't be able to change that during runtime unless you had like a shortkey or readln etc. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted February 4, 2012 Author Share Posted February 4, 2012 What you are trying to do is not possible, at least not with practically with OSI. In order to use SMART at all using OSI's implantation you must define it which overrides all mouse/color routines. If you really wanted to you could not define SMART, still use OSI.. make all of your own custom functions that are found in smart.scar that use a boolean to use the smart function or revert to the normal one. Seems like a lot of work to do something that is pretty pointless. You definitely wouldn't be able to change that during runtime unless you had like a shortkey or readln etc. i think the point is being missed here, im trying to write a statement that says if Smart.scar is defined then check to see if it is "enabled" before continuing. right now im using the SmartEnabled function that returns a Boolean, true if it is enabled or false if it is not enabled. i would like to only call the SmartEnabled function if smart is defined. other wise if the user is using something else other than smart it will not call it. Quote Link to comment Share on other sites More sharing options...
FHannes Posted February 4, 2012 Share Posted February 4, 2012 Hmm, {$IFNDEF ...} is a compiler directive, it's handled before the script is compiled, If you use {$IFNDEF SMART} ... {$ENDIF} and SMART is defined with the $DEFINE directive, then all of the code in the $IFNDEF clause is removed from the script before it's even compiled. If SMART isn't defined, your code will throw a compiler error, because SmartEnabled will not exist in the script. Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted February 4, 2012 Author Share Posted February 4, 2012 Hmm, {$IFNDEF ...} is a compiler directive, it's handled before the script is compiled, If you use {$IFNDEF SMART} ... {$ENDIF} and SMART is defined with the $DEFINE directive, then all of the code in the $IFNDEF clause is removed from the script before it's even compiled. If SMART isn't defined, your code will throw a compiler error, because SmartEnabled will not exist in the script. yeah, ive never really messed with them a whole lot, i knew they were used by the compiler, i just thought it the {if de..} was true then it would add the code to the script where if it was not defined then it wouldnt add anything and just skip that section. Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted February 4, 2012 Share Posted February 4, 2012 (edited) im using the SmartEnabled function that returns a Boolean, true if it is enabled or false if it is not enabled.Everybody seems to have missed this bit, which was the entire point of the original post. Your {$IFNDEF} should be {$IFDEF}. Your loop should work as written. Whether the function is working as it is documented is another matter (WaitFuncEx was broken for the longest time). I would try writing a script that does nothing except writeln the status of SmartEnabled, run the script with smart enabled, run the script with smart disabled, and see what the result is. Edited February 5, 2012 by Bixby Sayz Quote Link to comment Share on other sites More sharing options...
Wanted Posted February 5, 2012 Share Posted February 5, 2012 Ah shit? I thought you meant SMART itself being enabled or disabled. Not like the Clicking disable thing (like disable debug) yea this is probably easy give me a min Quote Link to comment Share on other sites More sharing options...
shadowrecon Posted February 5, 2012 Author Share Posted February 5, 2012 Ah shit? I thought you meant SMART itself being enabled or disabled. Not like the Clicking disable thing (like disable debug) yea this is probably easy give me a min yeah, figured thats what you were getting at, lol. i just hate starting a script and it loging out because i didnt enable smart.. lol ---------- Post added at 01:05 AM ---------- Previous post was at 01:04 AM ---------- Everybody seems to have missed this bit, which was the entire point of the original post. Your {$IFNDEF} should be {$IFDEF}. Your loop should work as written. Whether the function is working as it is documented is another matter (WaitFuncEx was broken for the longest time). I would try writing a script that does nothing except writeln the status of SmartEnabled, run the script with smart enabled, run the script with smart disabled, and see what the result is. it works if its not in the {IfDef..} brackets but i think you solved my problem =) Quote Link to comment Share on other sites More sharing options...