www.ClassicTW.com
https://mail.black-squirrel.com/

send burst on the hour server side
https://mail.black-squirrel.com/viewtopic.php?f=15&t=33125
Page 1 of 1

Author:  Tiberiusxix [ Mon Mar 26, 2012 9:25 pm ]
Post subject:  send burst on the hour server side

I'm terrible at writing scripts, am trying to learn but there are only so many hours in a day. :(

My question is, how would I structure a script that would react to a trigger - send a burst, and then send bursts on server side hour every hour until I shut it off?

i.e

12:45 (trigger burst)
1:00 (burst)
2:00 (burst)

I got 1/2 through writing a delaytrigger when I realized that it wouldn't work for what I wanted to do :(

Thanks in advance :)

Author:  Vid Kid [ Mon Mar 26, 2012 9:44 pm ]
Post subject:  Re: send burst on the hour server side

Tiberiusxix wrote:
I'm terrible at writing scripts, am trying to learn but there are only so many hours in a day. :(

My question is, how would I structure a script that would react to a trigger - send a burst, and then send bursts on server side hour every hour until I shut it off?

i.e

12:45 (trigger burst)
1:00 (burst)
2:00 (burst)

I got 1/2 through writing a delaytrigger when I realized that it wouldn't work for what I wanted to do :(

Thanks in advance :)


You will probably want to use the system clock to trigger off of.
you do not say what you want to burst , the reason a say , is because system side bursts will not slow server down and may not do what you want.
Most of what you would do on a server side will need pacing to keep it in control.

I think you may get better help if you describe what you are doing or show an example (even if only in words to outline what you want to accomplish)

Sorry I could not be of any better help , but I work with what I was given :(

Author:  Tiberiusxix [ Mon Mar 26, 2012 9:49 pm ]
Post subject:  Re: send burst on the hour server side

NP,

I'd like to have a simple script that sits in my base watching for fig hits. If a hit happens adjacent to where I'm sitting I want to ptorp that sector, and then hit it on the hour when turns regen so the potential invader can't get away or clamber into my base.

Author:  Kaus [ Mon Mar 26, 2012 9:51 pm ]
Post subject:  Re: send burst on the hour server side

You said server side, so I got thinking about t-edit scripts. If I'm barking up the wrong tree I apologize in advance. But I wrote this while loop awhile back to trigger off specific (PM) time and figured it might help you.

Code:
setVar $flag 0
While ($flag = 0)
SetDelaytrigger emq :emq 350
pause
:emq
Send "ctq"
  Waitfor "PM"
  Getword CURRENTLINE $time 1
   ReplaceText $time ":" #32
   Getword $time $min 2
   Getword $time $sec 3
  If ($min = 59) and ($sec > 57)
    Send $Mac
    add $flag 1
  end
end

Author:  Vid Kid [ Mon Mar 26, 2012 9:54 pm ]
Post subject:  Re: send burst on the hour server side

oh , that is not a server side script ...
server side deals mostly with Tedit and TWGS operations.

Your looking for a turn based script that is used to photon on the hour
after an adj fig hit .. ok , that can be done.

The triggers for on the hour is when you recover XX turns .. but you do have to make sure your player has room for said turns or you stop getting these messages.

Be warned , a fast macro can get away from that in the same way you
trigger for the turns.

better help this time :)

Author:  T0yman [ Mon Mar 26, 2012 9:59 pm ]
Post subject:  Re: send burst on the hour server side

This runs off your computer clock. You can pretty it up, but I wrote it so it would make sense what it was doing.

Code:
#Top of the hour run script.

settexttrigger 0 :go "Enter Text To Trigger Off"
pause
:go
load scriptname
setdelaytrigger 1 :check 60000
pause
:check
gettime $minute "nn"
if ($minute = "59")
   goto :second
else
   setdelaytrigger 2 :hold 30000
   pause
   :hold
   goto :check
end

:second
gettime $second "ss"
if ($second < 10)
   goto :go
else
   setdelaytrigger 3 :temp 100
   pause
   :temp
   goto :second
end


Or you could just set a trigger to key off when you get turns... there are other ways to get the server side time but it would have to send ctq to get the time and then start a counter to top of the hour. Sending the "ctq" will spam your screen constantly, not a big deal if your afk but if at the key it would be a PITA.

Author:  Kaus [ Mon Mar 26, 2012 10:09 pm ]
Post subject:  Re: send burst on the hour server side

T0yman wrote:
This runs off your computer clock.


The issue with using gettime is it uses your time, if your out of sync with the server it will fire that top of the hour torp at the wrong time.

Author:  T0yman [ Mon Mar 26, 2012 10:12 pm ]
Post subject:  Re: send burst on the hour server side

Kaus wrote:
T0yman wrote:
This runs off your computer clock. You can pretty it up, but I wrote it so it would make sense what it was doing.


The issue with using gettime is it uses your time, if your out of sync with the server it will fire that top of the hour torp at the wrong time.

Yea I would just key off the ansi for getting turns it is the simplest way. :) Simple is always better ... :lol:

Author:  Kaus [ Mon Mar 26, 2012 10:15 pm ]
Post subject:  Re: send burst on the hour server side

T0yman wrote:
Kaus wrote:
T0yman wrote:
This runs off your computer clock. You can pretty it up, but I wrote it so it would make sense what it was doing.


The issue with using gettime is it uses your time, if your out of sync with the server it will fire that top of the hour torp at the wrong time.

Yea I would just key off the ansi for getting turns it is the simplest way. :) Simple is always better ... :lol:


100% agreed, I've spent so much time scripting and over complicating things when something as basic as a waitfor would have worked just fine.

Author:  T0yman [ Mon Mar 26, 2012 10:30 pm ]
Post subject:  Re: send burst on the hour server side

Just because I was bored here is one more but again it could be off a few ms and not fire at top of the hour. I would still key off the turns message but I already had this one almost done so here :)

Code:
:top
send "ctq"
settexttrigger 1 :gettime "PM"
settexttrigger 2 :gettime "AM"
pause
:gettime
killalltriggers
cuttext CURRENTLINE $min 4 2
cuttext CURRENTLINE $sec 7 2
setvar $time 60
subtract $time $min
multiply $time 60000
setvar $second 60
subtract $second $sec
multiply $second 1000
add $time $second
setdelaytrigger 3 :go $time
pause
:go
load script here
goto :top

Author:  Promethius [ Tue Mar 27, 2012 2:04 am ]
Post subject:  Re: send burst on the hour server side

Personally I think this type of defense is flawed, but it is up to you so....

Code:
# just so you know it has activated - popping a window
Window TOH_Ptorp 200 75 "TOH Ptorp"
setWindowContents TOH_Ptorp "TOH Ptorping Active*"

# $startUpRun is used to prevent ptorping if you start
# the script at xx:00:xx minutes.
setVar $startUpRun 1

# should check for ptorp quantity to make sure you have them
# $hitSector must be passed to this

:checkTime
send "ctq"
setTextTrigger AM :chk "AM"
setTextTrigger PM :chk "PM"
pause

:chk
killTrigger PM
killTrigger AM
cutText currentline $min 4 2
if ($min <> "00")
   setVar $startUpRun 2
   setVar $timeDelay (59 - $min) * 60000
   if ($timeDelay = 0)
       setVar $timeDelay 25
   end
   setDelayTrigger checkTime :checkTime $timeDelay
   pause
else
   if ($startUpRun = 1)
       goto :checkTime
   end
   send "cpy" $hitSector "*q"
   setDelayTrigger mDelay :checkTime 90000
   pause

end

Author:  Tiberiusxix [ Tue Mar 27, 2012 7:27 am ]
Post subject:  Re: send burst on the hour server side

Wow, thanks guys - you've given me a ton to look at when I get back from work tonight.


Promethius wrote:
Personally I think this type of defense is flawed, but it is up to you so....


What would you recommend as an afk defense then? The afk ptorp thing was something I thought about like 10 min before bed.

I'm just getting back into the game after being out for about 6 years, and am pretty far behind again :(

Author:  Promethius [ Tue Mar 27, 2012 10:59 am ]
Post subject:  Re: send burst on the hour server side

Tiberiusxix wrote:
Wow, thanks guys - you've given me a ton to look at when I get back from work tonight.


Promethius wrote:
Personally I think this type of defense is flawed, but it is up to you so....


What would you recommend as an afk defense then? The afk ptorp thing was something I thought about like 10 min before bed.

I'm just getting back into the game after being out for about 6 years, and am pretty far behind again :(


The script I posted did not address all items - holo scan to verify that a player is still in sector prior to/after the top of hour ptorp launch for instance, and if not the actions to take.

If the base is moveable and you don't think you can defend then you would be better off moving it. If it isn't moveable and you can't defend it then abandon it - better than being SD. A lot depends on the opponents skill on how you would react. I would still do the initial ptorp of the player, and SD them if possible - AFK attacks are dangerous though.

If you go this route to defend your base, you might want to couple this with a citkiller if you have the resources. Just be aware of the defender ships being used to burn your figs down.

If you can on your initial ptorp, do it a couple of sectors out so you can retreat to your base and reset. This way they can't simply dscan to see your base is adjacent.

A lot of factors go into an AFK defensive setup.

Author:  ElderProphet [ Thu Mar 29, 2012 7:12 pm ]
Post subject:  Re: send burst on the hour server side

You can use setEventTrigger in TWX to create a trigger that will fire when the clock strikes a certain time. The ideal way to use it would be to first determine the time offset between your computer and the server's clock, then use this offset whenever specifying the schedule.

But I agree that this is NOT a sure fire way of photoning someone at the top of the hour, after they get turns back, but before they can move.

+EP+

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/