View unanswered posts | View active topics It is currently Thu Jan 01, 2026 7:52 am



Reply to topic  [ 5 posts ] 
 Can't get trigger to fire 
Author Message
Gameop

Joined: Mon Jan 15, 2007 2:41 am
Posts: 342
Unread post Can't get trigger to fire
Here is a snippet of code from my farm script. I am running into issues though. I have been looking at it off and on for 4 days now so I need an extra set of eyes. My main concern is the trigger for under construction. I can't seem to get this trigger to fire. I have tried scanning from cit, dropping into the sector and displaying with no luck. The port upgrade is not completely functional either but I just have not debugged it yet. Once I got stuck on the under construction I got focused on it.

Code:
:check_ports
        killalltriggers
        waitfor "Citadel command (?"
        setTextLineTrigger port_blown :port_blown "<=-DANGER-=>  Scanners indicate massive debris and heavy"
        setTextLineTrigger under_construction :under_construction "(Under Construction - "
        setTextLineTrigger port_here :port_here "Class"
        setTextLineTrigger needs_port :build_port "Warps to Sector(s)"
        send "s*  "
        pause

        :port_here
           killalltriggers
          IF (PORT.CLASS[$CURRENT_SECTOR] <> 3)
               send "qmnt*  c  "
               waitfor "Citadel command"
                        gosub :quikstats
                        IF ($FIGHTERS < $SHIP_MAX_ATTACK)
                                send "'{" $bot_name "} - Not Enough Fighters to Blow Port*"
                                goto  :end_check_ports
                        ELSE
                                send "q q pay" $SHIP_MAX_ATTACK "*  q  z  n *  l  " & #8 & #8 & $planetToFill & "*  mnt*  c  "
                                goto  :end_check_ports
                        END
         ELSE
                        killalltriggers
                        waitfor "Command [TL="
                        setvar $total_creds_needed 0
                        send "o *"
                        settextlinetrigger upgrading_port :upgrade_port "Choice ?"
                        settextlinetrigger under_construction :under_construction "Command [TL="
                        pause

                        :upgrade_port
                                echo "made it to upgrade the port***"
                                halt
                                killalltriggers
                 send "o 1*"
                 waitfor "0 to quit)"
                 getword currentline $totalFuelUpgradeNeeded 9
                 striptext $totalFuelUpgradeNeeded "("
                 striptext $totalFuelUpgradeNeeded ","
                                send "o 2*"
                 waitfor "0 to quit)"
                 getword currentline $totalOrgUpgradeNeeded 9
                 striptext $totalOrgUpgradeNeeded "("
                 striptext $totalOrgUpgradeNeeded ","
                                send "o 3*"
                 waitfor "0 to quit)"
                 getword currentline $totalEquipUpgradeNeeded 9
                 striptext $totalEquipUpgradeNeeded "("
                 striptext $totalEquipUpgradeNeeded ","
                                send "l  " & #8 & #8 & $planetToFill & "*  c  "
                                setVar $total_creds_needed 300*$totalFuelUpgradeNeeded
                 setVar $total_creds_needed $total_creds_needed+500*$totalOrgUpgradeNeeded
                 setVar $total_creds_needed $total_creds_needed+1000*$totalEquipUpgradeNeeded
                 IF ($total_creds_needed > $CREDITS)
                 setVar $cashonhand $CITADEL_CREDITS
                 add $cashonhand $CREDITS
                 IF ($cashonhand > $total_creds_needed)
                  send "T T " & $CREDITS & "* "
                       send "T F " & $total_creds_needed & "* "
                       setVar $CREDITS $total_creds_needed
                       send "q q"
                                           send "o 1" & $totalFuelUpgradeNeeded & "*"
                       waitfor "Command [TL="
                       echo "****"&$totalOrgUpgradeNeeded
                       send "o 2" & $totalOrgUpgradeNeeded & "*"
                       waitfor "Command [TL="
                       echo "****"&$totalFuelUpgradeNeeded
                       send "o 3" & $totalEquipUpgradeNeeded & "**"
                       waitfor "Command [TL="
                       echo "****"&$totalFuelUpgradeNeeded
                       send "l  " & #8 & #8 & $planetToFill & "*  mnt*  c"
                       goto  :end_check_ports
                                     ELSE
                                           send "'{" $bot_name "} - Not Enough Credits in Cidatel to Upgrade Port*"
                                           goto  :end_check_ports
                                     END
                                END
      END
                goto  :end_check_ports

:build_port
        killalltriggers
        IF ($CREDITS < 50000)
                send "T F 50000*"
                gosub :quikstats
                IF ($CREDITS < 50000)
                        send "'{" $bot_name "} - Not Enough Credits to Make Ports*"
                        send "q q q z n * l  " & #8 & #8 & $planetToFill & "*  c  *"
                END
        ELSE
                send "q q q z n * o3y" $portname "* l  " & #8 & #8 & $planetToFill & "*  c  *"
        END

:end_check_ports
        killalltriggers
        RETURN

:port_blown
        killalltriggers
        send "q q q z n * l  " & #8 & #8 & $planetToFill & "*  c  *"
        goto :end_check_ports

:under_construction
        killalltriggers
        echo "***port under construction****"
        halt
        goto :end_check_ports

_________________
Where Chaos Reigns TW Server
chaos-twgs.com:23


Sat Aug 18, 2012 10:23 pm
Profile ICQ
Commander

Joined: Sun Feb 25, 2001 3:00 am
Posts: 1838
Location: Guam USA
Unread post Re: Can't get trigger to fire
In this kind of condition , I use a CR* from the cit. and check the % port has and its max ... that way if the port is used .. it moves on .. if its under construction .. it too moves on because the value is < 1% available and max < 1%

I hope this helps.
It does shorten the script module as well.

_________________
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


Sat Aug 18, 2012 10:37 pm
Profile WWW
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1133
Location: Augusta, GA
Unread post Re: Can't get trigger to fire
I've troubleshot trigger problems for people before where the problem turned out to be Escape Codes (e.g. #27[2,15) enclosed within the text they were trying to trigger off of. I wrote a utility script once that displayed the incoming text and Esc Codes to a TWX window, and logged it to a file, to help with just this sort of problem. I'm not sure if it's included in the scripts Helix zipped from me, but let me know if that would be helpful, and I'll attempt to locate it.

And if that still fails to shed some light on it, let me know and I'll look into it.

Regards,
+EP+

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


Sun Aug 19, 2012 8:38 pm
Profile WWW
Gameop

Joined: Mon Jan 15, 2007 2:41 am
Posts: 342
Unread post Re: Can't get trigger to fire
I hope that is the case because it would fix my issue. I got delusional the other night trying to fix this. I started moving parts of the code that I know had no bearing on the trigger, but I was out of ideas and options. I did compares to other scripts that were similar. Lonestar has a scrip that uses the same trigger so I even copied his over and nothing. I will look and see if it was part of what Helix got.

_________________
Where Chaos Reigns TW Server
chaos-twgs.com:23


Mon Aug 20, 2012 9:42 am
Profile ICQ
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post Re: Can't get trigger to fire
Just as a guess, but killalltriggers might be causing it. It appears that the trigger on "Class" goes to:

:port_here
killalltriggers

_________________
               / Promethius / Enigma / Wolfen /

"A man who has no skills can be taught, a man who has no honor has nothing."


Tue Aug 21, 2012 1:14 am
Profile ICQ
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 26 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.