View Full Version : Alarm Suggestion
Travis E
01-08-2013, 03:49 AM
Rcently i've been wishing i could have a fixed set of waypoints (hunting loop) that my alarm for detect players is on. But when i deposit i want it to go off. I don't care if players are in the depot, i care if they are trying to red skull me with a missplaced exori by stair hopping. I have x-Ray on and a safe exori script, but i have noticed x-ray isn't 100% on everything.
-Thanks in advance! :P
Niels
01-08-2013, 06:04 PM
You can fix this using load settings I think. I have never used this command so I can't tell you how to use it in detail. Just make 2 different alarm settings for when you are refilling and for when you are hunting. Then you add (loadsettings, someting) to the label where you leave the spawn and change it back at the label keephunting. I think you'll get the idea, but first you should find out how to use load settings properly.
I hope this helps
XtrmJosh
01-08-2013, 08:30 PM
You can do something like this:
hunting = true --(set this false when you go to deposit, and true when going to hunt)
while hunting and paround() >= 1 do
playsound("alert.wav")
end
Not sure if paround() is correct, you'll need to find someone who knows... Maybe Spectrus or someone can shed some light?
DarkstaR
01-08-2013, 08:53 PM
You can do something like this:
hunting = true --(set this false when you go to deposit, and true when going to hunt)
while hunting and paround() >= 1 do
playsound("alert.wav")
end
Not sure if paround() is correct, you'll need to find someone who knows... Maybe @Spectrus (http://forums.xenobot.net/member.php?u=3) or someone can shed some light?
1. Never loop in something meant to mesh with events (in this case, label events). You will block the thread from getting the events.
2. Pretending 1 isn't an issue, it would only work once. If "paround() >= 1" evaluated to false, the loop would go bye-bye.
3. Pretending 1 and 2 aren't issues, it would only work once. After hunting was set to false the first time, the loop would go bye-bye.
4. Never while without a wait().
You have the right idea, but this should be done with modules. I'd post proper code, but I'm at work.
XtrmJosh
01-08-2013, 09:37 PM
1. Never loop in something meant to mesh with events (in this case, label events). You will block the thread from getting the events.
2. Pretending 1 isn't an issue, it would only work once. If "paround() >= 1" evaluated to false, the loop would go bye-bye.
3. Pretending 1 and 2 aren't issues, it would only work once. After hunting was set to false the first time, the loop would go bye-bye.
4. Never while without a wait().
You have the right idea, but this should be done with modules. I'd post proper code, but I'm at work.
Out of interest, if this were run as a separate lua file, would the variable still be available? Assuming that it would, and that each file gets its own thread, this shouldn't really cause any issue, though I would now advise OP not to run it since, as you said, it will block the events thread...
Syntax
01-08-2013, 09:51 PM
Out of interest, if this were run as a separate lua file, would the variable still be available? Assuming that it would, and that each file gets its own thread, this shouldn't really cause any issue, though I would now advise OP not to run it since, as you said, it will block the events thread...
Since each file does get it's own thread, no you would not be able to communicate with another script through the variable. If it was run as a separate lua file it wouldn't block the events thread (because it would have no event) but it would run the CPU 100%+- since you don't sleep in between loops.
cuckied
05-21-2013, 02:51 PM
someone help with modules names, all this will work with it correctly
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.