• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Anti-Afk

Status
Not open for further replies.

kj_

kj_

Level 5
Joined
Aug 1, 2008
Messages
134
Guys I want a trigger that if a specific unit is standing on same place for more than 2minutes it will move to a specific location only when standing. If it is on same place attacking for longer 2 minutes I want it to be left alone ...
I've been playing around with the triggers but I can't seem to figure this out
Help will be apprec.
 
Level 5
Joined
Nov 14, 2007
Messages
161
a 2 trigger system i made:
  • Anti Afk Timer
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
          • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
          • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
          • -------- for all players who actually play --------
    • Actions
      • Countdown Timer - Start TimerArray[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in 120.00 seconds
and 2 would need one per player
  • Afk Triggered Red
    • Events
      • Time - TimerArray[1] expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to (Center of GoToRegion <gen>)
ot tested, but should work, let me know if it doesnt.
 
Level 12
Joined
Mar 16, 2006
Messages
992
a 2 trigger system i made:
  • Anti Afk Timer
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
          • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
          • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
          • -------- for all players who actually play --------
    • Actions
      • Countdown Timer - Start TimerArray[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in 120.00 seconds
and 2 would need one per player
  • Afk Triggered Red
    • Events
      • Time - TimerArray[1] expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 1 (Red)) and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to (Center of GoToRegion <gen>)
ot tested, but should work, let me know if it doesnt.

This is sort of the right/wrong way about it.

You need to reset the timer every time a command is issued. That's a big deal.
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
(I am not quoting the same trigger for the third time, this still relays to it)
You need to reset the timer every time a command is issued. That's a big deal.
You can add a condition to the first trigger, something like
  • Unit Ordered
    • Conditions
      • Time Elapsed for TimerArray[ (Player number of (Owner of unit (Ordered unit) ) ) > 1sec
, so it won't reset timer every time a player clicks anywhere.

Also, the second trigger can be wrought one time for all players, like this:
  • Afk Triggered Red
    • Events
      • Time - TimerArray[1] expires
      • Time - TimerArray[2] expires
      • Time - TimerArray[3] expires
      • --------- and so on for all players ---------
    • Conditions
    • Actions
      • For each Integer A from 1 to PlayerCount
        • If ... then ... else
          • Conditions
            • (Remaining time for TimerArray[Integer A] equals to 0.00)
          • Actions
            • -------- here is what happens to afk players--------
 
Status
Not open for further replies.
Top