Jump to content
Sign in to follow this  
anusmangler

how to use a trigger to "activate" after a script is run

Recommended Posts

I got a laptop you hack with addaction ["hack"; "hacktop.sqf"] is it possible to have a trigger detect weather the script has run fully and you can only walk so far before you "lose connection" so you have to stay close to the laptop while its downloading. I need the trigger to activate when its done to fire the set task state to successful so everyone knows its time to bail out and go. any way of doing it like that or some other simpler way?

Share this post


Link to post
Share on other sites

use a publicvariable in your script and use that as the condition for the trigger.

ie. script has - LaptopHacked = true

Trigger condition is simply LaptopHacked

edit: oops - didn't read the whole thing. Give me a sec.

Can you post your hacked.sqf so the required code can go into it at the right place?

An idea below - probably won't work but a good start I hope.

_time = 0;while {!(LaptopHacked)} do {
   if ((_this select 1 distance _this select 0) >=5) then {
       hint "you are too far from Laptop";
       exitwith {};
   };
   sleep 1;
   _time = _time + 1;
   if (_time == 10) exitwith {hint "Laptop Hacked!";LaptopHacked = true:};
};

Edited by KevsnoTrev

Share this post


Link to post
Share on other sites

hacktop.sqf "hint "1%";

sleep 0.5;

hint "2%";

sleep 0.5;

hint "3%";

sleep 0.5;

hint "4%";

sleep 0.5;

hint "5%";

sleep 0.5;

hint "6%";

sleep 0.5;

hint "7%";

sleep 0.5;

hint "8%";

sleep 0.5;

hint "9%";

sleep 0.5;

hint "10%";

sleep 0.5;

hint "11%";

sleep 0.5;

hint "12%";

sleep 0.5;

hint "13%";

sleep 5;

hint "25%";

ect...

hint "100%"

i dont have anything else. not a super expricened "scripter" but i understand the method sort of. Mainly what im after is after the laptop is hacked then the modual that dictates it was succesful then sets off the next "set task" mod that provides you with a location to a guy to give the information to.

Edit: that part i can handle i just need the trigger to work.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×