Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Death
Apprentice


Joined: 25 Jun 2002
Posts: 109
Location: USA

PostPosted: Sun Jul 06, 2003 6:25 am   

capture script question
 
#TRIGGER "AuctionTrigger" {^~[AUCTION~] Now taking bids on (*).} {#if ((@afk = "yes")) {:News:#showp %ansi( black, bright)At %ansi( green, bright)%time( tt) %ansi( black, bright) "";#cap News;#gag} {:News:#showp %ansi( black, bright)At %ansi( green, bright)%time( tt) %ansi( black, bright) "";#cap News;#send {auction info}}} "Global"
#COND {^(%w) is currently auctioning~:$} {#cap News;#gag} {within|param=5}
#COND {And the current high bidder is (%w), with a bid of %n).} {#cap News;#gag;#state AuctionTrigger 0} {looplines|param=15}

I did something like this but with who AWHILE ago and I completely forgot how I did it, and I lost the trigger I did it with too. So now I'm trying do it again with auction. Now with that right there, I'm getting the first line and the last line captured to the window, but how do I get everything inbetween? I'm sure it can be made alot easier, cause I've done it before with just 1 #condition to it. If anyone can help me and keep it with just 1 trigger and not involve any classes that would be sweet.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jul 06, 2003 8:39 am   
 
I don't see any reason to use a multi-state trigger here. It looks like you would always want to capture any of these lines, no matter what order they appear in.

#TRIGGER "AuctionTrigger" {^~[AUCTION~] Now taking bids on (*).} {#if ((@afk = "yes")) {:News:#showp %ansi( black, bright)At %ansi( green, bright)%time( tt) %ansi( black, bright) "";#cap News;#gag} {:News:#showp %ansi( black, bright)At %ansi( green, bright)%time( tt) %ansi( black, bright) "";#cap News;#send {auction info}}} "Global"
#TR {^(%w) is currently auctioning~:$} {#cap News;#gag}
#TR {And the current high bidder is (%w), with a bid of %n).} {#cap News;#gag;#state AuctionTrigger 0}
Reply with quote
Death
Apprentice


Joined: 25 Jun 2002
Posts: 109
Location: USA

PostPosted: Sun Jul 06, 2003 5:22 pm   
 
[AUCTION] Now taking bids on Blade.
Object 'Blade' is type weapon, extra flags no_locate.
Weight is 4, value is 100, level is 18.
Worn: Wielded
Material: none
Weapon type is sword.
Damage is 7d6 (average 24).
[Socket 1] jewel of Aggression
Adds 2 to Damroll
Affects damage roll by 2.
And the current high bidder is None, with a bid of 0.

That's what a standard auction looks like when auction info is sent. With the trigger I mentioned, it only capture and gags the beginning line saying there's an auction, sends the auction info command, then captures the first line of the auction, misses all the inbetween stuff and captures and gags the last line. I wrote a trigger like I said that did what I'm trying to do using 1 #cond statement to the trigger, but I can't remember how I did it. I want to capture and gag everything of the auction info into the News window. Sorry if I didn't explain it very well.

On a side note, this forum takes FOREVER to load and 80% of the time I try to go to a new thread or back to a forum, I get the "Page Cannot Be Displayed" error, hit refresh, wait a few minutes to load it, get the error again, hit refresh, wait more time for it to load up so I can read/reply to a post or see the forum. I mean, it doesn't even have any pictures to load up as avatars or anything. Anyways, thanks for any help.
Reply with quote
Death
Apprentice


Joined: 25 Jun 2002
Posts: 109
Location: USA

PostPosted: Sun Jul 06, 2003 5:42 pm   
 
#TRIGGER "AuctionTrigger" {^~[AUCTION~] Now taking bids on (*).} {#if ((@afk = "yes")) {:News:#showp %ansi( black, bright)At %ansi( green, bright)%time( tt) %ansi( black, bright) "";#cap News;#gag} {:News:#showp %ansi( black, bright)At %ansi( green, bright)%time( tt) %ansi( black, bright) "";#cap News;#gag;#send {auction info};#temp {And the current high bidder is (%w), with a bid of (%n).} { #state AuctionTrigger 0}}}
#COND {(%w) is currently auctioning:} {#cap News;#gag} {within|param=5}
#COND {} {#cap News;#gag} {looplines|param=15}

After spending more time looking around at testing it, I finally got it to work. So there is the finished product.
Reply with quote
dereinei
Newbie


Joined: 20 Sep 2019
Posts: 1

PostPosted: Fri Sep 20, 2019 1:22 pm   
 
Actually, neither of the answers above traps the ssh error code and message, which could be done as follows (ignore my custom functions):

# move the deployment package from the tmp dir
msg=$(ssh -i "$(eval echo $identity_file)" -o ConnectTimeout=5 "$ssh_user"'@'"$ssh_server" \
sudo -iu "$etl_user" bash "$tgt_deployment_dir"'/src/bash/'"$run_unit/$run_unit"'.sh' \
-a create-relative-package 2>&1)

# fail on any non-success
export exit_code=$?
export err_msg="network error: ""$msg"
test $exit_code -ne 0 && doExit $exit_code $err_msg
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net