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
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Sat Jul 29, 2006 12:31 am   

tweaking my database
 
this is the trigger code when i see a piece of equipment/weapon/mob/object in a room that adds its name, location, and vnum to a database. it is quite slow though and i was wondering if anyone could suggest some speed tweaks.

Code:
#pri {
  #var armor.name %trim( %replace( %replace( @armor.name, worn), "()"))
  #var armor.vnum %roomnum
  #var armor.zone %zonenum
  #if (@database = 1) {#if (%query( (&Name=@armor.name)&(&Zone=%zonename( @armor.zone)))) {#var armor {}} {#NEW item {name=@armor.name|vnum=@armor.vnum|zone=@armor.zone|type="armor"}}} {}
  }
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Wed Oct 18, 2006 6:42 pm   
 
Code:
#TRIGGER {^~(a~)%e[1;37m(&armor.name)%e[0m} {
  #pri {
    #var armor.name %trim( %replace( %replace( @armor.name, worn), "()"))
    #var armor.vnum %roomnum
    #var armor.zone %zonenum
    #if (@database = 1) {
      #if (%query( (&Name=@armor.name)&(&Zone=%zonename( @armor.zone)))) {
        #var armor {}
        #DBRESET
        } {#NEW item {name=@armor.name|vnum=@armor.vnum|zone=@armor.zone|type="armor"}}
      #DBRESET
      } {}
    }
  } "" {color}


currently my database has grown to about 1000 mobs/items/armour/weapons and is slow as can be when running this script. i was wondering if anyone had a way to optimize this or any other speedup tricks? it lags for about 5 seconds each time this trigger fires.
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