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 Goto page 1, 2  Next
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Sun May 04, 2008 3:27 am   

[2.23] #EVENT lag
 
This frequently #RAISE'd event seems to cause alot of lag where typed text would not even show for several seconds.

#EVENT onKilled {
$killed=%1
$numkilled=%eval(1+@myKills.$killed)
#ADDKEY myKills {$killed=$numKilled}
}


@mykills has over 1000 entries
_________________
Discord: Shalimarwildcat
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun May 04, 2008 3:32 am   
 
Is @myKills.$killed compiling properly? Seems like it should be @{myKills.$killed}. Also, if it has that many entries, perhaps you should look into using Dharkael's excellent Sqlite script to make a real database?
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Sun May 04, 2008 4:01 am   
 
No errors on the compiled tab, so i assume it is.

I didn't think i would end up with this many entries when i started the script.
Or that such a simple thing would require a full database, are the lookups so much faster?
_________________
Discord: Shalimarwildcat
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Sun May 04, 2008 4:07 am   
 
Just sneaking in here for a quick peek. I'm not going to answer most of the posts until Monday, but I saw an obvious problem here that I wanted to help with.

Whenever you use %eval (or #EXEC), you are forcing CMUD to delay the execution until runtime. The expression within %eval is not compiled...it is treated as a string value and then compiled and executed each time it is run. This will make your script very slow.

Whenever you think about using %eval or #EXEC (or variations), always ask yourself if it is absolutely necessary. The proper way to write this script is simply this:
Code:
#EVENT onKilled {
  $killed=%1
  $numkilled=(1+%db(@myKills,$killed))
  #ADDKEY myKills $killed $numKilled
}

That's it. Simple and easy. The syntax @mykills.$killed *might* also work, but I wouldn't risk it. And using the @{mykills.$killed} also causes delayed runtime evaluation instead of compile-time evaluation. Using the %db function is the best. The function call gets compiled, and the arguments get compiled. %db is designed to work optimally with the hash-table record database variables.

I also adjusted #ADDKEY because the {key=value} syntax also requires additional runtime parsing. Using the normal syntax of "#ADDKEY varname key value" is the most optimal.

Try to get out of your bad zMUD habits. zMUD needed %eval everywhere. CMUD rarely needs it. Like I said, if you find yourself using %eval, then you should always think twice about whether it's really needed, or if it's just left over from zMUD scripting.

Since CMUD is using real hash tables for database variables, it's going to be the fastest. Any sort of "real database" is going to be slower, even in Lua. There isn't any need for a "real database" in the example that was posted.

Finally, you can make your script slightly faster by making $killed a named argument in the argument list at the bottom of the settings editor and then removing the "$killed=%1" line.

The number of entries in @mykills won't matter in my version of the script, because CMUD will keep @mykills as a hash table and never need to convert it back and forth to a string. Using %eval with @mykills.$killed is converting the hash table to a string value, which will be slower and slower as the variable grows. Getting rid of %eval should solve it.

If it's still slow with my version, then let me know because that means there is still a bug with hash tables somewhere. And I'm not in a place where I can test this in CMUD myself right now.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Sun May 04, 2008 4:59 am   
 
i am still getting bogged down by this even with your code
it is especially noticable when i leave the settings editor open

if it matters i am running two instances of cmud and i also have a trigger as follows:

#TR {{@myskills}} {#CW saddlebrown}

i dont see the argument list you speak of though
_________________
Discord: Shalimarwildcat
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun May 04, 2008 1:32 pm   
 
It's a box labelled "Params" at the bottom, next to notes. The names of the variables go in there, separated by commas, $s optional but preferred.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Sun May 04, 2008 4:06 pm   
 
This discussion prompted me to go through my code and eliminate the %eval uses throughout it. However, I wasn't able to get rid of the following:

$modified_health = (0.85*(%eval( %db( @settings_heal, health_sip)))) + %int( %if( @lost_bal( elixir), 300, -800))

Where: %db( @settings_heal, health_sip) = @max_health*0.78

Since the db variable contains a variable, unless I do an %eval it doesn't work. I have to leave %db( @settings_heal, health_sip) as a variable because the value @max_health can change at any time.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun May 04, 2008 5:00 pm   
 
I was trying out various things, and this worked absolutely fine:

$modified_health = ((0.85*(%db(@settings_heal,"health_sip")))+%if(@lost_bal("elixir"),300,-800))

I've changed a few things (added brackets around the whole thing, put quotes around your strings, removed lots of extra spaces including the ones that were making you need %int for the return from the %if), so I'm not sure which change made the difference, but it works.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Mon May 05, 2008 1:16 am   
 
Awesome, I'll have to give it another try. Thanks for the help.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Mon May 05, 2008 10:08 pm   
 
I am still having the issue, about 10 seconds worth of lag each time the event fires, according to the timestamps.

As soon as i disable the event all the lag is gone.
_________________
Discord: Shalimarwildcat
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon May 05, 2008 10:33 pm   
 
So just doing:

#RAISE onKilled

will cause the lag? If so, can you send me a file containing your huge @myKills variable so that I can test this here? I tried creating a large database variable and couldn't get this to cause such a lag. Maybe my computer is fast, but I should at least be able to see some sort of time issue. Also show me exactly what your event contains right now.

I just can't see any way for this to take 10 seconds...that's a huge amount of time.

Can you also reproduce it if you put this event (and the variable) in a clean session all by itself?
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon May 05, 2008 10:38 pm   
 
shalimar wrote:
i am still getting bogged down by this even with your code
it is especially noticable when i leave the settings editor open

if it matters i am running two instances of cmud and i also have a trigger as follows:

#TR {{@myskills}} {#CW saddlebrown}

i dont see the argument list you speak of though


I'm confused what that trigger has to do with the problem?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Mon May 05, 2008 11:08 pm   
 
My trigger thats calls the event is:

<trigger priority="100" id="10">
<pattern>(%w) {killed|dealt the death blow to}{ | the }(*).$</pattern>
<value>$killer=%1
$killed=%2
#CO red
#RAISE onLoot $killed
#IF ($killer="You") {#RAISE onKilled $killed}</value>
</trigger>

The event is:

<event event="onKilled" priority="150" id="15">
<value>$numkilled=(1+%db(@myKills,$killed))
#ADDKEY myKills $killed $numKilled</value>
<arglist>$killed</arglist>
</event>

Oldguy2: I dont think it has anything to do with it myself, i just threw it out as a 'just in case'

Looking into it with another session, it worked flawlessly, untill i added in the color trigger, then i got the 10 seconds of lag again.

So for goood or ill,
#TR {{@myskills}} {#CW saddlebrown}
looks to be the problem child.

Does it not like huge stringlists, or is it complaining cause i am using a database variables instead of a true stringlist?
_________________
Discord: Shalimarwildcat
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon May 05, 2008 11:19 pm   
 
Is the @myskills variable in the color trigger changing a lot? Each time it changes, that trigger needs to re-expand the database variable into a regular expression, which could take some time, but not 10 seconds.

A huge database variable or huge string list (either one) might cause a slow color trigger, because the regular expression parser has to deal with all of that text for each line received from the MUD. Vijilante might know more about the speed of such triggers. But I can't imagine that it would take 10 seconds. That's a *long* time in computer time.

I'm still not seeing how the color trigger and your event are related at all, and yet you said that you didn't get the delay until you added the color trigger. So now I'm *very* confused. Because you also said earlier that just disabling the onKilled event also got rid of the delay.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Mon May 05, 2008 11:32 pm   
 
Well very rarely is a new item added... but the kill count goes up quite frequently.

Seems I was mistaken about the event disabled resolving the lag. Since it now seems to not be the cause. (same lag disabled or not)
I think it just coincided with text the color trigger was not firing on.

(I had assumed the event was the cause, because after each hang i would see the kill message from the mud.)

But when i turn the color trigger off there is no lag at all.

I dont really see why they would interact either.
_________________
Discord: Shalimarwildcat
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue May 06, 2008 3:04 am   
 
How many items are in the @myskills that you are using in the color trigger? If you can give us a dump of that variable, then I can try it here to see what kind of lag I get with it. It's possible that there is some bug that is causing the trigger regex to be recreated all of the time instead of cached.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Tue May 06, 2008 3:10 am   
 
currently at 1081



Code:
accountant=3|affluent citizen=2|Agatean ambassador=1|Agatean boatswain=1|aged bodyguard=1|aged rujona=3|ageing skewbald horse=1|ageing yellowish horse=1|aggressive boatswain=1|aggressive bodyguard=1|aggressive weapons master=1|agile warrior=1|agile warrior mercenary=2|agitator=2|alert Fang bodyguard=1|alert Hong bodyguard=3|alert McSweeney bodyguard=2|alert Tang bodyguard=4|Alice Cloye=1|angry dwarf fighter=1|angry fighter=1|angry human fighter=1|annoyed peasant=1|annoying child=1|architect=2|army officer=12|arrogant citizen=5|arrogant Fang nobleman=1|arrogant hunter=1|arrogant man=1|arthritic grflx worker=4|ashamed ronin=2|assertive fighter=1|Auriental spitz dog=1|bald Hong bodyguard=4|bald McSweeney bodyguard=3|bald Sung bodyguard=2|bald Tang bodyguard=1|bandit=39|bandit leader=2|bandit sentry=3|barkeep=1|barman=2|bear=6|bearded D'reg=1|beautiful athletic woman=18|beautiful female captive=2|beautiful hunter=2|beautiful old woman=1|beautiful red roan horse=1|belligerent dwarf warrior=1|belly dancer=2|bent hengeyokai=1|besotted dwarf warrior=2|big boned hog=1|big boned sow=1|big shaggy lion=4|black boarhound=2|black scorpion=1|black wolf=4|bloated bullfrog=3|boastful deckhand=1|boastful sailor=1|bodyguard=9|bold Fang bodyguard=1|bold Hong bodyguard=2|bold Sung bodyguard=2|bold Tang bodyguard=1|bored deckhand=1|bored Fang dealer=1|bored grflx worker=2|bored Hong dealer=1|bored palace guard=1|bored sailor=2|bossy dapple grey foal=1|bossy grflx workleader=3|bouncy grey and white foal=1|bouncy grey foal=1|bow legged young fighter=1|Boy Willie=4|brave Hong samurai=1|brave McSweeney samurai=1|brawny bodyguard=1|brawny Djelian soldier=6|brawny Ephebian soldier=1|brawny sailor=1|brawny Tsortean soldier=4|bridge troll=1|brigand=17|brigand leader=4|bright rujona=1|broad-shouldered crewman=1|broad-shouldered first mate=1|brown rat=2|brutal Fang samurai=1|brutal Fang thug=1|brutal Hong samurai=2|brutal Hong thug=2|brutal McSweeney thug=1|brutal Sung thug=2|buck toothed bodyguard=1|buff-necked ibis=1|bulky dwarf fighter=2|bulky tsimo wrestler=1|bulky white bear=2|burly bodyguard=1|burly citizen=2|burly dwarf warrior=2|burly man=3|burly officer=2|burly smuggler=2|burly soldier=5|burly troll=1|busty D'reg woman=2|busy-looking scruffy man=1|calm woman=1|calm young fighter=1|camel herder=1|Captain Ptargos=1|cautious Fang merchant=1|cautious patroller=3|cautious scorpion=1|ceremonial guard=111guard|ceremonial sentry=3|Charles Marchella=4|charming gentleman=1|cheerful child=1|chiselled nitsuni=2|chivalrous Fang samurai=1|chivalrous musketeer=1|chivalrous Tang samurai=1|choleric bodyguard=1|chow chow dog=1|Christopher of Gufnork=1|chubby baby grflx=2|chubby child=1|chubby Ephebian recruit=1|city guard=36|city sergeant=1|clever Hublandish barbarian=3|clever sensei=1|clever thief=1|coachman mouse=4|cockroach=1|cocky Fang nobleman=1|cocky youth=1|Coffee Nostra hitman=1|commanding knight=1|complacent child=1|complacent fighter=1|complacent Hong nobleman=1|complacent McSweeney nobleman=1|complacent Sung nobleman=1|complacent Tang nobleman=1|contemplative captain=1|contemplative citizen=5|contemplative officer=1|contemplative soldier=4|cooing penguin=1|corpse-eating rat=1|courteous child=1|cowardly pickpocket=1|crafty monk=10|craven Hong thug=2|craven McSweeney thug=4|craven Sung thug=2|craven Tang thug=1|creamy wolf=1|creepy child=2|croaking bullfrog=1|cross-eyed fighter=1|cruel pirate=2|cruel seafarer=1|cunning Fang bodyguard=1|cunning Hong bodyguard=2|cunning McSweeney bodyguard=2|cunning Sung bodyguard=1|cunning Tang bodyguard=2|cute baby grflx=3|Cuthbert the Amazing Leaping Alligator=3|cynical palace guard=2|Dame Sufferland=4|dapper gentleman=1|dappled doe=1|dark ranger=1|darling camel=1|dashing brigand=1|dastardly fighter=2|deadly warrior mercenary=3|dejected beggar=1|Delbert=3|delicate doe=1|delicate fawn=1|demented fighter=2|depressed beggar=3|depressed sailor=1|deranged fighter=3|desiccated desert nomad=5|despicable ronin=2|devout warrior mercenary=2|Diego Montoya=2|diligent student=6|diligent young fighter=1|dirty child=2|dirty fighter=3|dirty grandchild=1|dirty grass wolf=1|dirty rogue=1|dirty servant=1|dirty urchin=4|dirty vagabond=3|disciplined Djelian mercenary=1|disciplined Djelian soldier=3|disciplined Ephebian soldier=3|disciplined troll warrior=1|disciplined Tsortean soldier=6|disciplined warrior=1|disgraced ronin=1|disgusting child=2|dishonourable ronin=1|disruptive Ephebian sailor=1|disruptive Genuan sailor=1|disruptive sailor=2|Djelian ambassador=1|docker=8|dockside merchant=3|dopey looking lion=3|downcast beggar=1|drunk citizen=5|drunk party-goer=1|drunk sailor=2|drunken dwarf=15|drunken dwarf warrior=1|drunken rogue=1|drunken sailor=6|duke's quail=1|dull grflx adolescent=13|dull rujona=4|dusty casual labourer=1|dusty D'reg=3|dusty grflx worker=5|dusty stone mason=1|dwarf bodyguard=2|dwarf gazelle=1|dwarfish barkeep=5|eager beggar=1|eager nitsuni=1|eagle nosed bandit=1|easy-going hunter=1|effeminate hunter=1|efficient grflx workleader=3|elderly man=1|elegant gentleman=1|energetic Hong merchant=1|energetic Sung salesman=1|Enrico Persuica=3|Ephebian ambassador=2|evil-looking rogue=1|excellent student=6|excitable pickpocket=1|excited bandit=1|executive manager=1|exhausted woman=1|expansive trader=1|expensive merchant=1|experienced Djelian soldier=3|experienced Ephebian soldier=2|experienced student=10|experienced Tsortean soldier=7|expert nitsuni=1|extravagant Fang merchant=1|extravagant Tang dealer=1|faithful young fighter=1|fallen ronin=2|Fang captain=2|farmer=2|Farnem Failey=3|fat bullfrog=2|fat dealer=2|fat doe=1|fat drunkard=1|fat duck=1|fat dwarf fighter=1|fat dwarf warrior=1|fat engineer=1|fat grflx adolescent=4|fat labourer=7|fat man=1|fat merchant=1|fat rujona=4|fat trader=2|fat troll=2|fat troll fighter=1|fat weapons master=2|fearful ronin=4|fearsome rogue=1|female ninja=1|ferrety bandit=1|fierce bodyguard=1|fierce hunter=1|fig trader=2|filthy hengeyokai=1|First Mate Antonis=2|fisherman=5|flustered civil servant=2|foreign looking bodyguard=1|foul-mouthed grandchild=1|foul-smelling tramp=2|Frankie Harvard=2|Freaky Kept=2|Freda Glottik=2|friendly fisherman=1|friendly fishmonger=1|friendly grass wolf=1|Fujiyama Osanawa=2|gallant Fang samurai=1|gallant palace guard=1|gallant Tang samurai=1|gangly Djelian recruit=1|gangly Ephebian recruit=1|gangly painted dog puppy=5|gangly Tsortean recruit=1|garrulous witch=1|garter snake=6|genteel lady=9|gentle buck=1|gentle doe=3|gentle fawn=1|gentle noh actor=1|Genuan ambassador=1|Geraldo Ciaco=3|giant=22|giant leader=15|giant spider=1|gleeful party-goer=2|gloomy beggar=1|glossy ibis=1|Gnirble the gnoll=1|Go Hitokui=2|good looking bodyguard=1|good natured bodyguard=1|good-looking skipper=1|graceful Hong samurai=1|graceful McSweeney samurai=1|graceful poet=2|graceful Sung samurai=1|graceful warrior mercenary=3|Granpa Clown=1|greedy merchant=3|greedy poacher=3|greedy trader=4|grey wolf=6|Grflx=1|grflx soldier=15|grim captain=2|grinning man=2|grizzled Djelian soldier=3|grizzled Ephebian mercenary=1|grizzled Ephebian soldier=1|grizzled McSweeney thug=1|grizzled Tsortean soldier=8|grizzly bear=2|groggy party-goer=1|groomed grflx mentor=5|grubby child=3|grubby hermit=2|grubby scarred thug=8|grubby urchin=1|grumpy drunkard=1|grumpy dwarf warrior=4|grumpy grflx workleader=5|grumpy skewbald horse=1|grumpy tharga beast=1|Guido of Gapp=2|gullible pickpocket=1|Hachi Hitokui=1|haggling Fang saleswoman=1|haggling Hong merchant=1|hairless dog=1|Halen of Sandelfon=1|handsome McSweeney nobleman=1|handsome ranger=1|handsome wealthy man=1|happy Fang samurai=2|happy Fang trader=2|happy man=1|happy McSweeney mandarin=1|happy McSweeney vendor=1|happy noh actor=1|happy red roan foal=1|happy sailor=2|happy Sung samurai=1|happy Tang samurai=1|happy troll=1|happy-looking old penguin=1|harbour guard=35|harbour mistress=2|hardened D'reg=4|hardworking merchant=3|haughty Sung nobleman=1|healthy citizen=5|healthy smuggler=3|heavily muscled man=12|heavy tsimo wrestler=1|hefty bodyguard=1|hefty captain=1|hefty labourer=4|hefty soldier=8|heroic palace guard=2|Hito Hitokui=1|holy man=1|homesick sailor=2|honey haired bodyguard=1|Hong captain=5|honourable scribe=1|honourable sensei=1|Howondalandish ambassador=2|huge bodyguard=7|huge human fighter=1|huge troll=9|huge troll fighter=1|hulking tallyman=1|hulking troll=4|humourless grflx worker=4|hunter grflx=25|hyperactive baby grflx=2|hyperactive woman=2|ice giant=1|Ichi Hitokui=1|Ickle Babby Clown=1|idle palace guard=2|ignoble ronin=1|immaculate gentleman=1|impatient Fang nobleman=1|Imperial guard=1111guard|important Sung nobleman=1|important Tang nobleman=1|impoverished citizen=2|independent Morporkian sailor=1|indifferent brigand=1|industrious grflx worker=5|inebriated barge sailor=1|inebriated sailor=1|injured student=5|innocent pickpocket=5|innocent urchin=2|inquisitive child=1|insane pirate=1|insane weapons master=1|insolent civil servant=2|intelligent warrior mercenary=1|intimidating bodyguard=1|intimidating weapons master=1|intruder=9|irate woman=1|irresponsible bandit=1|irritated sailor=2|jaundiced Fang thug=2|jaundiced McSweeney thug=2|jaundiced Sung thug=4|jaundiced Tang thug=1|jealous ronin=1|Jeef Lirwyn=2|jittery pickpocket=1|John DeBois=2|jolly trader=1|jovial priestess=1|Juggles Clown=1|jumpy mercenary=2|jumpy palace guard=1|keen patroller=1|Kyakenko=1|Laggy-san=1|large Djelian soldier=2|large D'reg=1|large Ephebian soldier=3|large Fang bodyguard=1|large grflx mentor=5|large Hong bodyguard=1|large man=3|large McSweeney bodyguard=2|large pine=1|large savage lion=1|large Tang bodyguard=2|large troll=1|large troll warrior=1|large Tsortean mercenary=1|large Tsortean soldier=1|lazy palace guard=1|lazy penguin=1|lean ranger=1|lean troll warrior=1|learned student=1|lethargic labourer=6|light-footed smuggler=1|lithe captain=1|lithe officer=2|lithe soldier=3|little baby grflx=1|little bay foal=1|little old lady=14|looming troll=4|loquacious Hong merchant=1|lost-looking cartographer=1|loud Fang salesman=1|loud Fang saleswoman=1|loud McSweeney vendor=1|loud priestess=1|loud Sung merchant=1|loud Tang trader=1|Louis Accardo=2|lovely barmaid=1|loyal McSweeney samurai=1|lucky gambler=1|lumbering troll=3|mad mystic=3|magnificent McSweeney samurai=2|magnificent Sung samurai=1|malevolent rogue=2|malnourished doe=1|mangy fighter=2|mangy looking lion=4|manipulative dealer=1|manipulative trader=1|Marlon Gumboni=1|massive eagle=4|matted hengeyokai=2|McSweeney captain=3|mean fighter=3|mean looking lion=1|mean mercenary=17|mean rogue=3|mean troll=3|mean troll fighter=1|meek poet=1|member of the Merchant Guard=5|mercenary=10|merchant=7|merry party-goer=2|messy baby grflx=1|messy grflx adolescent=9|messy hermit=1|meticulous fighter=1|mild calligrapher=1|mischievous child=2|modest noh actor=1|monstrous outlaw=1|morose grass wolf=1|Morporkian ambassador=1|Morporkian spy=1|mosquito watcher=1|mossy troll=1|mournful beggar=1|mousey wealthy woman=1|muddy grflx worker=13|Mummy Clown=1|muscled barbarian=1|muscular citizen=3|muscular doe=1|muscular Fang bodyguard=1|muscular Hong bodyguard=1|muscular Hong nobleman=1|muscular labourer=2|muscular McSweeney bodyguard=2|muscular officer=1|muscular smuggler=1|muscular smuggler captain=1|muscular soldier=5|muscular Tang bodyguard=3|mysterious wealthy man=1|mystical ninja=1|Nana Hitokui=2|nasty fighter=2|nasty lawyer=1|nasty pickpocket=1|nerdy grflx adolescent=9|nervous Djelian recruit=2|nervous Ephebian recruit=2|nervous pickpocket=3|nervous Tsortean recruit=4|Ni Hitokui=2|noble Fang samurai=1|noble knight=1|nomadic D'reg=2|Noobie=1|notorious ronin=2|obnoxious child=1|obnoxious rat=1|obnoxious youth=2|odorous bandit=1|odorous bodyguard=1|off-duty soldier=4|officer=1|officious civil servant=1|oily weapons master=4|old dwarf warrior=1|old hedge wizard=1|old Hublandish barbarian=2|old musketeer=2|old sailor=2|old stone mason=1|old student=2|old troll=1|old Tsortean sailor=2|Old Vincent=4|Ome outlaw=10|ordinary poet=1|outgoing D'reg woman=1|outgoing merchant=3|outgoing trader=1|overworked fishmonger=1|painted dog=8|palace guard=1guard|pale hengeyokai=1|paperboy=1|pasty stone mason=1|Paulie Clemence=7|peacekeeper commander=3|pickpocketing child=3|pietistic woman=1|pigeon chested outlaw=1|pimply grflx adolescent=12|pine sapling=2|pleasant looking gentleman=13|pleasant street sweeper=2|plumbeous ibis=1|plump bay horse=1|plump blood bay foal=1|plump blue roan foal=1|plump yellowish foal=1|polite child=1|poor beggar=4|poor citizen=4|poor tramp=1|pouting young fighter=1|powerful young fighter=1|precocious McSweeney nobleman=1|precocious Tang nobleman=1|pretentious Tang nobleman=1|protective Fang bodyguard=1|protective Hong bodyguard=3|protective McSweeney bodyguard=1|protective Tang bodyguard=3|proud first mate=1|proud Hong nobleman=2|proud McSweeney samurai=1|proud penguin chick=1|proud Sung samurai=1|proud Tang samurai=1|psychotic strongarm=1|pugnacious dwarf warrior=1|puissant monk=4|puna ibis=2|quick rujona=1|quiet dealer=1|quiet Hong vendor=1|quiet man=1|quiet salesman=1|quiet Tang vendor=1|quirky bodyguard=2|Quisoda=1|rabbity civil servant=2|ragged citizen=2|rangy Djelian soldier=4|rangy Ephebian soldier=6|rangy troll warrior=3|rangy Tsortean soldier=4|rat=2|recalcitrant youth=1|red squirrel=2|red wolf=1|redwing thrush=2|regal knight=3|reluctant grflx worker=6|renowned dwarf warrior=1|renowned Fang samurai=1|renowned McSweeney samurai=1|resigned beggar=1|resourceful Hong trader=1|resourceful McSweeney merchant=1|retired tsimo wrestler=1|rich ambassador=1|rich beggar=1|rich citizen=2|rickshaw driver=1|Rixacardo=3|Roku Hitokui=2|rough sailor=7|rowdy woman=10|rude brigand=1|rude Hong nobleman=1|rugged Djelian soldier=3|rugged Ephebian soldier=1|rugged Hublandish barbarian=3|rugged troll=2|rugged troll warrior=4|rugged Tsortean soldier=6|rugged warrior=1|ruthless pirate=2|sad beggar=1|sad man=5|Sadel Noctus=2|sadistic chef=1|sadistic rogue=1|sad-looking penguin=1|sailor=4|Samuel Casso=2|San Hitokui=1|sarcastic grflx workleader=2|sassy mugger=3|scampering child=1|scarlet ibis=2|scarred Hong bodyguard=3|scarred McSweeney bodyguard=1|scarred Sung bodyguard=2|scarred weapons master=1|scary mugger=5|scary rogue=1|scheming child=1|scrappy urchin=5|scrawny brown foal=1|scrawny labourer=2|scribe=2|scruffy boatswain=1|scruffy palace guard=1|scruffy shopper=1|security guard=5|self confident hunter=2|Septa DeBlano=2|Serec=1|serious captain=1|serious looking hunter=1|shadowy thief=1|shady character=5|shady dealer=1|shady Fang vendor=1|shady Sung vendor=1|shady Tang merchant=1|shaggy skewbald horse=1|shaggy white bear=7|shaggy white dog fox=1|sharp-tailed ibis=3|Shi Do Gai=1|shifty merchant=1|shih-tzu dog=1|shiny grflx mentor=2|shopkeeper=1|short child=1|short dealer=3|short deckhand=1|short Djelian recruit=3|short dwarf warrior=3|short Ephebian recruit=2|short Fang bodyguard=3|short Hong bodyguard=3|short McSweeney bodyguard=1|short merchant=2|short poacher=2|short Sung bodyguard=1|short Tang bodyguard=2|short trader=1|short troll=1|short Tsortean recruit=5|short weapons master=1|short woman=1|shrewd desert nomad=3|shrewd warrior mercenary=1|shy baby grflx=2|shy D'reg woman=1|shy old woman=1|sickly smuggler=1|sickly smuggler captain=3|silent nitsuni=2|silly drunkard=3|sinewed rujona=1|sinister Hong thug=2|sinister McSweeney thug=1|sinister rogue=1|sinister Sung thug=1|sinister Tang thug=1|Sir Ricard du Bois=1|skilled student=2|skinny bodyguard=1|skinny child=1|skinny Djelian recruit=1|skinny doe=1|skinny Ephebian recruit=5|skinny fawn=1|skinny fighter=1|skinny priest=1|skinny Tsortean recruit=1|skittish bay horse=1|Sleep-With-Me-Own-Fishes DiBlarr=1|slender bodyguard=1|Slim Stevie=2|slimy lawyer=1|slimy mugger=4|slimy weapons master=1|slippery weapons master=1|slow mugger=7|sluggish smuggler=1|sly brigand=1|sly desert nomad=2|sly monk=7|sly outlaw=1|sly urchin=4|small dark brown dog=1|small dwarf warrior=1|small grey and white horse=1|small red vixen=1|small woman=1|smart palace guard=1|smelly child=1|smelly hengeyokai=1|smelly man=1|smelly mugger=2|smelly rujona=1|smiling child=1|smiling mugger=5|smiling warrior=1|snarling mugger=4|snarling rogue=1|sneaky lawyer=1|sneaky mugger=7|sneaky nitsuni=2|sneaky pickpocket=2|sneaky smuggler captain=2|snotty grandchild=1|snow eagle=1|soldier=2|solemn ranger=2|song thrush=1|Sparadigm=1|squinting rujona=1|stalwart warrior mercenary=3|starving urchin=4|statuesque bodyguard=2|stern grflx workleader=1|stern sensei=1|stevedore=3|Stevie Cicone=4|sticky baby grflx=7|stinking drunkard=1|stinking vagabond=1|stinky grandchild=1|stocky dwarf warrior=4|stony troll child=1|stony troll warrior=1|strict captain=2|stringy desert nomad=3|strong dwarf=1|strong dwarf warrior=1|strong Fang bodyguard=1|strong Fang samurai=2|strong Hong bodyguard=5|strong Hublandish barbarian=2|strong McSweeney bodyguard=1|strong McSweeney samurai=3|strong ronin=2|strong Tang bodyguard=2|strong-willed deckhand=1|strong-willed seafarer=1|stubble cheeked hunter=1|stuck-up woman=1|stumpy grflx adolescent=9|stupid child=1|stupid grflx adolescent=7|stupid human fighter=2|stupid mugger=2|stupid smuggler captain=1|stupid troll fighter=1|sturdy warrior mercenary=2|sulky grey foal=1|Sum Dim crested dog=2|Sung captain=1|sun-tanned D'reg=1|sun-tanned farming labourer=1|sun-tanned stone mason=1|swarthy pirate=1|sweating banker=1|swift assassin=1|sycophantic McSweeney vendor=1|sycophantic merchant=2|sympathetic bartender=2|talented calligrapher=1|talkative Fang dealer=1|talkative Fang merchant=1|talkative Fang salesman=1|talkative Hong trader=1|talkative man=1|talkative McSweeney vendor=1|tall camel trader=1|tall captain=1|tall crewman=1|tall D'reg=3|tall engineer=1|tall Fang bodyguard=2|tall giraffe=2|tall Hong bodyguard=2|tall Hong mandarin=1|tall Hong samurai=2|tall kabuki actor=1|tall McSweeney bodyguard=3|tall merchant=1|tall priestess=2|tall ronin=2|tall Sung bodyguard=1|tall Sung samurai=1|tall Tang bodyguard=1|tall Tang nobleman=2|tall trader=3|tall weapons master=1|terrifying troll=1|thin dealer=1|thin dwarf warrior=2|thin ginger cat=1|thin merchant=1|thin party-goer=1|thin sow=1|thin trader=1|thoughtful citizen=5|thoughtful soldier=7|thrifty dealer=2|thrifty merchant=2|thrifty trader=1|timid Djelian recruit=2|timid pickpocket=2|timid Tsortean recruit=2|tiny duckling=5|tiny painted dog puppy=1|tiny sparrow=1|tired citizen=6|tired fisherman=1|tired palace guard=1|tired sensei=1|tired shopper=2|tired woman=1|tired-looking camel trader=1|toothless bodyguard=2|toothless old lion=1|tough bodyguard=2|tough Djelian soldier=5|tough dwarf fighter=1|tough Ephebian soldier=6|tough Fang thug=1|tough Hong thug=2|tough Hublandish barbarian=2|tough human fighter=2|tough McSweeney thug=1|tough sailor=1|tough Sung thug=1|tough troll=1|tough troll fighter=2|tough troll warrior=3|tough Tsortean soldier=4|tough warrior=1|towering giraffe=1|towering troll=4|T'paz=1|Triad boss=4|Triad heavy=15|Triad thug=75|tricky monk=7|troll bodyguard=8|Truckle the Uncivil=1|tsimo handler=6|Tsortean ambassador=1|twisted hengeyokai=1|ugly grflx mentor=5|ugly tom cat=1|Uncle Blacksheep Clown=2|unctuous musketeer=1|unhappy black zombie=1|unhealthy citizen=1|unpretentious fighter=1|unseen nitsuni=1|unshaven hunter=1|venerable monk=6|very young penguin chick=1|veteran Fang bodyguard=5|veteran Hong bodyguard=7|veteran Tang bodyguard=2|vicious pirate=1|vicious Tang samurai=1|vigilant Fang bodyguard=2|vigilant Hong bodyguard=4|vigilant McSweeney bodyguard=5|vigilant palace guard=1|vigilant patroller=1|vigilant Sung bodyguard=1|vigilant Tang bodyguard=2|vile rujona=1|violent drunkard=1|virtuous McSweeney samurai=1|virtuous Sung samurai=1|wandering Djelian soldier=4|wandering D'reg=1|wandering Ephebian mercenary=1|wandering Ephebian soldier=1|wandering shopper=2|wandering troll warrior=2|wandering Tsortean soldier=6|wandering warrior=1|warty bullfrog=1|wary barbarian=1|wary dark horse=1|wary desert nomad=2|wary Fang thug=1|wary McSweeney thug=2|wary patroller=3|wasted hengeyokai=1|watchful palace guard=1|watchman=6|wattled ibis=1|wealthy warrior mercenary=4|weary Fang trader=1|weary grflx worker=3|weary Hong saleswoman=1|weary Hong trader=1|weary McSweeney merchant=1|weary Tang dealer=1|Weasel=1|weather beaten bodyguard=1|weatherbeaten Fang thug=2|weatherbeaten Hong thug=2|weatherbeaten McSweeney thug=2|weatherbeaten Sung thug=1|weathered Djelian soldier=7|weathered Ephebian soldier=2|weathered troll warrior=1|weathered Tsortean soldier=2|weathered warrior=1|weird mystic=4|well rounded hog=1|well-built D'reg=3|well-muscled dwarf=1|well-muscled man=2|well-muscled troll=3|well-off citizen=5|well-travelled sailor=2|whiny servant=1|white belt ninja=1|wild boar=2|wild mystic=5|wily thief=1|wiry desert nomad=5|wiry pickpocket=2|wiry woman=1|wise grflx mentor=3|wise monk=5|wise penguin=1|wistful bodyguard=1|witchy wizard=1|wizard=10|woman of low moral fibre=2|Won Artful Huckster=1|woolgathering hedge wizard=1|worried doe=2|wrinkled rujona=6|Yon Hitokui=1|young beggar=1|young brown horse=1|young child=1|young Djelian recruit=4|young dwarf warrior=1|young Ephebian recruit=2|young man=1|young musketeer=1|young painted dog=1|young penguin chick=1|young sailor=3|young sensei=2|young student=3|young troll=1|young Tsortean recruit=4|young warrior=5|youthful hunter=1|zombie town crier=4|Zoon sailor=8|zubby oolander=1|Zyuu Hitokui=2
_________________
Discord: Shalimarwildcat
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue May 06, 2008 3:23 am   
 
Um, ok, wow. I'll test that tomorrow and let you know what I find. For people who understand regular expressions, what CMUD is doing is converting your
Code:
#TR {{@myskills}} {#CW saddlebrown}

trigger into this internally:
Code:
#TR {{accountant|affluent citizen|Agatean ambassador|Agatean boatswain|aged bodyguard|aged rujona|ageing skewbald horse|...|zombie town crier|Zoon sailor|zubby oolander|Zyuu Hitokui}} {#CW saddlebrown}

And because #CW can color multiple words within the same line, it can run this trigger multiple times on the same line if it finds a match. I don't know what the limits are in the PCRE engine, but this might be pushing the limits.

Vijilante: Any ideas on how I might implement this better? Or is this really the only way I can easily convert a string list/database variable into a regex trigger?
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Tue May 06, 2008 4:49 am   
 
Having several trigs like that back in zmud used to causes slowness even with shorter lists.

Since I'm mentioning zmud, I'll go the old format:

#TR {{@enemies}} {#CW 12}
#TR ((@allies}} {#CW 12}
was fairly standard for most people, but when I tried creating a whole bunch of lists.. to colour people with tradeskills, people in order, guild, city, enemy cities etc, it really bogged down the trig parser.


So I figure its not unlikely that a single LARGE list might cause lag also.


#LOOPDB @myskills {#ADDI mysKillsList {%key}}

Create a stringlist version of the dbvar, and try using that in the trig, to see whether it is quicker as a stringlist.
_________________
Athlon 64 3200+
Win XP Pro x64
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Tue May 06, 2008 9:04 am   
 
Changing to a real stringlist does remove the lag, so is the database variable aspect that causes the trouble then.
_________________
Discord: Shalimarwildcat
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Tue May 06, 2008 11:45 am   
 
Yes, keep in mind that the variable used in the pattern (ignoring what appears to be a typo in the name: mykills vs myskills?) is a data record variable and not a normal string list. So, in your conversion example, Zugg, you need the =N parts, too.

Either way, that's one heck of a lot for any single trigger to process.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Tue May 06, 2008 11:59 am   
 
Yes it is alot, but I don't want to have two such large variables to keep track of.
I was trying to overload the usefulness of the database variable.

Is there a way that when a database variable is used like a stringlist, that the %values can be ignored and just use they %keys?

#TR {{%dbkeys(@myKills)}} {#CW saddlebrown}

Doesn't seem to work... are predefined functions in trigger patterns no longer expanded?

Compiled pattern shows unmatched braces
_________________
Discord: Shalimarwildcat
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue May 06, 2008 12:57 pm   
 
I think the syntax is %%dbkeys()
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Tue May 06, 2008 1:12 pm   
 
That fixed the compiled error, but its not matching anything.

<trigger priority="16000" id="16">
<pattern>{%%dbkeys~(@myKills~)}</pattern>
<value>#CW saddlebrown</value>
</trigger>

That makes it match, but now i have lag again.
_________________
Discord: Shalimarwildcat
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Tue May 06, 2008 1:23 pm   
 
Aha, I had forgotten that syntax. Thanks Fang!

This should probably be in another thread as a bug but I'll mention it here too.

(?:%%dbkeys(@dbvar)) as a REGEX trigger does work.
{%%dbkeys(@dbvar)} as a regular trigger does NOT work. Even if you edit it the way Shalimar has above. The first Item then must have a ( before it to match.

I added this little tidbit to the help files.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram

Last edited by Arminas on Tue May 06, 2008 1:40 pm; edited 2 times in total
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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