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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
harley
Apprentice


Joined: 05 Apr 2008
Posts: 121

PostPosted: Thu Oct 14, 2010 4:45 am   

Port alias
 
I have an alias, that, well I didnt make it.. Its called port
this is the xml for it
Code:
<alias name="port" id="133">
  <value>#if (%pos( "NoPortal", %roomFlags( ))) {
  #if (%pos( "NoPortal(ERROR)", %roomFlags( ))) {
    #say @ansiPrefix("Portal")@ansiHighlight("Room Is Flagged As ", 11)@ansiHighlight(%trim(%roomflags()),15)@ansiHighlight(" Aborting Speedwalk", 11)
    #abort 1
  } {
    #if (%regex( %roomFlags( ), ".*?NoPortal\((.*?)\).*?", $PortalCommand))
    {
      noport 1 0
      #exec $PortalCommand
      restoreport 1
    }
  }
}
#if (%roomFlags( )=="ImmortalHomes") {s}
#if (%iskey(@Portals,$Keyword)) {
  #if (((0!=%db( @PortalData."Hold Item")) AND (%item( %db( @Portals, $Keyword), 1)!=%db( @PortalData, "Held Item"))) OR (%db( @PortalData, "Dual Wield") AND (%db( @PortalData, "Portal Wish")==0))) {
    get %char(34)%item( %db( @Portals, $Keyword), 1)%char(34) %item( %db( @Portals, $Keyword), 2).%char(34)%item( %db( @Portals, $Keyword), 3)%char(34)
  }
  #if (%db( @PortalData, "Dual Wield") AND (%db( @PortalData, "Portal Wish")==0)) {
    rem second
  }
  #if ((%item( %db( @Portals, $Keyword), 1)!=%db( @PortalData, "Held Item")) OR (%db(@PortalData, "Hold Item") == 0)) {
    wear %char(34)%item( %db( @Portals, $Keyword), 1)%char(34)
  }
  enter
  #if ((0!=%db( @PortalData, "Hold Item")) AND (%item( %db( @Portals, $Keyword), 1)!=%db( @PortalData, "Held Item"))) {
    wear %char(34)%db( @PortalData, "Held Item")%char(34)
  }
  #if (%db( @PortalData, "Dual Wield") AND (%db( @PortalData, "Portal Wish")==0)) {
    dual %char(34)%db( @PortalData, "Secondary Weapon")%char(34)
  }
  #if (((0!=%db( @PortalData, "Hold Item")) AND (%item( %db( @Portals, $Keyword), 1)!=%db( @PortalData, "Held Item"))) OR (%db( @PortalData, "Dual Wield") AND (%db( @PortalData, "Portal Wish")==0))) {
    put %char(34)%item( %db( @Portals, $Keyword), 1)%char(34) %item( %db( @Portals, $Keyword), 2).%char(34)%item( %db( @Portals, $Keyword), 3)%char(34)
  }
  #raiseevent onPortal {$Keyword} {%roomkey()} {%item( %db( @Portals, $Keyword), 7)}
  #te %item( %db( @Portals, $Keyword), 7)
} {
  #if (%len( $Keyword)) {
    #if (%char( 34)"None"%char( 34)!=%db( @PortalData, "Default Bag")) {
      get $Keyword %if( %pos( ., %db( @PortalData, "Default Bag")), %left( %db( @PortalData, "Default Bag"), %pos( ., %db( @PortalData, "Default Bag"))-1), 1).%char( 34)%if( %pos( ., %db( @PortalData, "Default Bag")), %right( %db( @PortalData, "Default Bag"), %pos( ., %db( @PortalData, "Default Bag"))), %db( @PortalData, "Default Bag"))%char( 34)
    }
    #if (%db( @PortalData, "Dual Wield") AND (%db( @PortalData, "Portal Wish")==0)) {
      rem second
    }
    wear $Keyword
    enter
    #if (0!=%db( @PortalData, "Hold Item")) {
      wear %char(34)%db( @PortalData, "Held Item")%char(34)
    }
    #if (%db( @PortalData, "Dual Wield") AND (%db( @PortalData, "Portal Wish")==0)) {
      dual %db( @PortalData, "Secondary Weapon")
    }
    #if (%char( 34)"None"%char( 34)!=%db( @PortalData, "Default Bag")) {
      put $Keyword %if( %pos( ., %db( @PortalData, "Default Bag")), %left( %db( @PortalData, "Default Bag"), %pos( ., %db( @PortalData, "Default Bag"))-1), 1).%char( 34)%if( %pos( ., %db( @PortalData, "Default Bag")), %right( %db( @PortalData, "Default Bag"), %pos( ., %db( @PortalData, "Default Bag"))), %db( @PortalData, "Default Bag"))%char( 34)
    }
    #if (%isnumber( $RoomKey)) {
      #raiseevent onPortal {$Keyword} {%roomkey()} {$RoomKey}
      #te $RoomKey
    } {
      #raiseevent onPortal {$Keyword} {%roomkey()} {Unknown}
    }
  } {
    #addkey PortalData PortalList ""
    #loopdb @Portals {
      #addkey PortalData PortalList {%additem(%key"-"%zoneName( %roomZone( %item( %val, 7)))":port "%key, @PortalData.PortalList)}
    }
    #pick {p:KeyWord|o:1|%sort(@PortalData.PortalList)}
  }
}</value>
  <arglist>Keyword, RoomKey</arglist>
  <notes>Use A Portal</notes>
</alias>

In 3.1 It was working as planned.. I just re-upgraded to 3.3 and it broke.. again..
I ahve no idea what is wrong with it.. Now it wont grab the portal out of the bag.. it wont even recognize the bag..

Before I would "port wow" and it would pull the "war of wizards" portal out of the bag, wear it, enter, then put the portal back.. now it doesnt grab, it tries to do everything else.. so somewhere in here is a bug in 3.3.. i've looked all over.. can not find it.
Reply with quote
harley
Apprentice


Joined: 05 Apr 2008
Posts: 121

PostPosted: Thu Oct 14, 2010 4:53 am   
 
If you need other alias's / dbs I can get those for you as well.. I am just lost without this.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Oct 14, 2010 4:59 am   
 
To properly debug this, we'll need the variable data as well. At the very least @Portals and @PortalData and to a lesser degree @ansiPrefix and @ansiHighlight.
_________________
Asati di tempari!
Reply with quote
harley
Apprentice


Joined: 05 Apr 2008
Posts: 121

PostPosted: Thu Oct 14, 2010 8:50 pm   
 
@Portals
Code:
goldrush="train ticket|1||sat|42|0|1|2351"|call="aura sage portal whirlwind vortex|1||lug|5|0|1|32454"|acad="acad|1||lug|1|0|1|33847"

@PortalData
Code:
Level Check=0|Portals On=All|PortalList="goldrush-:port goldrush|call-:port call|acad-:port acad"|Default Bag=lug|Level=72|Portal Wish=0|Dual Wield=0|mylevel=64|Hold Item=rattle|Tier=0|Held Item=rattle

@Ansihighlight
Code:
<func name="ansiHighlight" id="145">
  <value>$Col1=%ansi($Color)
$Col2=%ansi(%bitxor($Color,8))
#RETURN %subregex($Input,"\b(\w)",%concat($Col1,"\1",$Col2))</value>
  <arglist>Input, Color</arglist>
</func>

ansiprefix
Code:
<func name="ansiPrefix" id="150">
  <value>#return %ansi(4)"["%ansi(12)$Script%ansi(4)"]"%ansi(15)": "</value>
  <arglist>Script</arglist>
</func>
Reply with quote
harley
Apprentice


Joined: 05 Apr 2008
Posts: 121

PostPosted: Thu Oct 14, 2010 9:38 pm   
 
I think i've figured it out
instead of having
Code:
get %char(34)%item( %db( @Portals, $Keyword), 1)%char(34) %item( %db( @Portals, $Keyword), 2).%char(34)%item( %db( @Portals, $Keyword), 3)%char(34)

I did
Code:
get %char(34)%item( %db( @Portals, $Keyword), 1)%char(34) %item( %db( @Portals, $Keyword), 2)~.%char(34)%item( %db( @Portals, $Keyword), 3)%char(34)

and it works
Reply with quote
alluran
Adept


Joined: 14 Sep 2005
Posts: 223
Location: Sydney, Australia

PostPosted: Sat May 21, 2011 11:39 am   
 
Haha, I come back after years of inactivity trying to solve a different issue and stumble across someone using one of my original scripts.

Hope you liked it :)
_________________
The Drake Forestseer
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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