View unanswered posts | View active topics It is currently Fri Apr 24, 2026 8:36 am



Reply to topic  [ 13 posts ] 
 scripting for speed waitfor or trigger? 
Author Message
Chief Warrant Officer
User avatar

Joined: Mon Mar 08, 2004 3:00 am
Posts: 193
Location: Canada
Unread post 
In a script where speed is critical, for example in an attack script which is faster? Waitfor or a text trigger?

_________________
A newb meets cit-killa early on day 4:

"1:31:39 AM P zyberi nice...almost had you
1:32:49 AM P zyberi ****ing bullshuit
1:32:56 AM P zyberi and you knwo it your Butt was grass
1:33:35 AM P zyberi you knockign me out set me back ****ign weeks with taht ****
1:34:27 AM P zyberi enjoy teh day you ****ign *****"


Wed Jun 01, 2005 9:31 am
Profile ICQ
Lieutenant Commander
User avatar

Joined: Thu Mar 21, 2002 3:00 am
Posts: 890
Location: USA
Unread post 
experience tells me they are about the same. I haven't run a speed comparison tho.
i.e.
waitfor "warps into"
settexttrigger killGemini :killGemini "warps into"

are the same for all practical purposes. I think if there was a difference, it would be in the less than 1ms range. Triggers, however, are way more fun to label! [:D]

_________________
http://tw-cabal.navhaz.com - THE TW info site

Man, I gotta quit showing up here...next thing you know i'll get dragged back in.


Wed Jun 01, 2005 1:18 pm
Profile WWW
Chief Warrant Officer
User avatar

Joined: Mon Mar 08, 2004 3:00 am
Posts: 193
Location: Canada
Unread post 
Thanks for the info Traitor.

_________________
A newb meets cit-killa early on day 4:

"1:31:39 AM P zyberi nice...almost had you
1:32:49 AM P zyberi ****ing bullshuit
1:32:56 AM P zyberi and you knwo it your Butt was grass
1:33:35 AM P zyberi you knockign me out set me back ****ign weeks with taht ****
1:34:27 AM P zyberi enjoy teh day you ****ign *****"


Wed Jun 01, 2005 1:27 pm
Profile ICQ
Ensign

Joined: Fri Sep 19, 2003 2:00 am
Posts: 247
Location: Canada
Unread post 
Of The 2 examples, which ever comes out to less lines of code is the one I would choose. I'm sure one will be a few lines less than the other. Of course we are still talking fractions of a second.

Zoso

_________________
No Quarter - Is what we offer our enemies


Wed Jun 01, 2005 2:32 pm
Profile ICQ
Chief Warrant Officer
User avatar

Joined: Mon Mar 08, 2004 3:00 am
Posts: 193
Location: Canada
Unread post 
I went with the waitfors just because it helps me keep better track of what my script is doing, and where it's supposed to be going.

_________________
A newb meets cit-killa early on day 4:

"1:31:39 AM P zyberi nice...almost had you
1:32:49 AM P zyberi ****ing bullshuit
1:32:56 AM P zyberi and you knwo it your Butt was grass
1:33:35 AM P zyberi you knockign me out set me back ****ign weeks with taht ****
1:34:27 AM P zyberi enjoy teh day you ****ign *****"


Wed Jun 01, 2005 2:41 pm
Profile ICQ
Warrant Officer

Joined: Sat Dec 15, 2001 3:00 am
Posts: 94
Location: USA
Unread post 
EP might be able to shed some light on this one, but I tend to use waitFor's like a setTextLineTrigger where I could parse text from the entire line vs a setTextTrigger which activates immediately on 'seeing' the text. The other side of that is that a waitFor doesn't jump to another area of code - it just proceeds to the next line where a trigger might have to jump several thousand lines to proceed. Its an interesting question, maybe we can figure out a way to test it out.

_________________
http://www.grimytrader.com


Wed Jun 01, 2005 8:20 pm
Profile WWW
Ambassador

Joined: Wed Feb 28, 2001 3:00 am
Posts: 1410
Location: Boo! inc. Ireland
Unread post 
If script execution speed has once again become an issue, to the point that milliseconds are relevant (what with some players having 50 ms pings), perhaps people should abandon twx/zoc/anything that is not compiled, and go look at Procomm/Qmodem/Telix again.


Wed Jun 01, 2005 9:38 pm
Profile
Commander

Joined: Sun Feb 25, 2001 3:00 am
Posts: 1838
Location: Guam USA
Unread post 
quote:
If script execution speed has once again become an issue, to the point that milliseconds are relevant (what with some players having 50 ms pings), perhaps people should abandon twx/zoc/anything that is not compiled, and go look at Procomm/Qmodem/Telix again.


I believe this is the right answer ..

the speed of a string of commands is no longer an issue when its
compiled , so with twx the issue would be if its not compiled .. it will take a few milies to compile ..

This being said .. execution times of command ?? really ..hehehe [;)]

_________________
TWGS V2 Vids World on Guam Port 2002
Telnet://vkworld.ddns.net:2002
Discord @ DiverDave#8374
Vid's World Discord

Founding Member -=[Team Kraaken]=- Ka Pla

Image
Winners of Gridwars 2010
MBN Fall Tournament 2011 winners Team Kraaken
Undisputed Champions of 2019 HHT Just for showing up!

The Oldist , Longist Running , Orginal Registered Owner of a TWGS server :
Vids World On Guam


Thu Jun 02, 2005 12:07 am
Profile WWW
Lieutenant

Joined: Sat Nov 06, 2004 3:00 am
Posts: 600
Location: USA
Unread post 
hmm, i got a script called Gemini from a pirates game, but it was for Zoc...heh heh
Custom wrote for him...heh heh... the surprise was it worked

_________________
Its not the Kill, Its the Thrill of the Chase
S: Min: 297 Max: 437 Average: 410 -- Just here to attack aliens
S: High/Low Removed   Average: 421
          


Fri Jun 03, 2005 3:42 pm
Profile ICQ WWW
Chief Warrant Officer
User avatar

Joined: Mon Mar 08, 2004 3:00 am
Posts: 193
Location: Canada
Unread post 
You coming to pirates tonight Zark? I've got a new script I wanna try out. =)

_________________
A newb meets cit-killa early on day 4:

"1:31:39 AM P zyberi nice...almost had you
1:32:49 AM P zyberi ****ing bullshuit
1:32:56 AM P zyberi and you knwo it your Butt was grass
1:33:35 AM P zyberi you knockign me out set me back ****ign weeks with taht ****
1:34:27 AM P zyberi enjoy teh day you ****ign *****"


Fri Jun 03, 2005 7:06 pm
Profile ICQ
Warrant Officer

Joined: Mon Apr 11, 2005 2:00 am
Posts: 84
Location: USA
Unread post 
I'm not sure about the time differences but I seem to think that text triggers can produce more unwanted results in the development process - especially when you forget that the same text is displayed at times you don't want it to trigger and failed to realize that when you were writing it. But then again, that is probably just a newbie mistake.

KB


Fri Jun 17, 2005 12:01 am
Profile ICQ
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1134
Location: Augusta, GA
Unread post 
There is no discernable speed difference in the triggering of either type. It would definately be <1 ms, unless you had hundreds of triggers waiting to fire. I would choose to use a waitFor if the next action were definate, instead of conditional. Like if I'm in a solo game, and I'm going to fire at anyone entering my sector, then I would have attack macros immediately following a waitFor. But if I need to see who warped in before I attack, then I'd use a text trigger, since you can control the processing and retriggering more efficiently from a :header.

waitFor "warps into"
send "ay9999*"
goto :checkSector

vs.
setTextTrigger maybePsion :whoDat "warps into"
pause
:whoDat
getWord CURRENTLINE $target 1
if ($target = "PSION")
send "ay9999*"
goto :checkSector
end
# Wasn't Psion, so retrigger and wait.
setTextTrigger maybePsion :whoDat "warps into"
pause
+EP+

_________________
Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.


Fri Jun 17, 2005 5:35 pm
Profile WWW
Ensign

Joined: Tue Jan 11, 2005 3:00 am
Posts: 297
Location: USA
Unread post 
Ouch, hehe.

_________________
--==[The Outfit]==--

Member of The Foundation

Hereby it is manifest, that during the time men live without a common power to keep them all in awe, they are in that condition which is called war; and such a war, as is of every man, against every man. For WAR, consisteth not in battle only, or the act of fighting; but in a tract of time, wherein the will to contend by battle is sufficiently known.
--Hobbes, Leviathan


Fri Jun 17, 2005 7:57 pm
Profile ICQ
Display posts from previous:  Sort by  
Reply to topic   [ 13 posts ] 

Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.