Re: [SCRIPT] DG Scripts

From: Torgny Bjers (tb@sbbs.se)
Date: 07/31/00


Peter Ajamian wrote:
>
>> * MANA LOADER SCRIPT
>> * BY ARTOVIL, ARCANE REALMS
>> * arcane-realms.dyndns.org:3011
>> set nextplr %self.people%
>>   while (%nextplr% != "")
>
>should be ("%nextplr%" != "")
>


MAJOR SNIP SNIP CUT OUT

OK... I am wrong. You are right! Feels good, doesn't it? ;)

Here's the WORKING version of this script (works on my DG Scripts pl7 now),
all thanks to Peter Ajamian who wrote the first version of this script, all
I did was add the if..halt..thing.

* start script
set nextplr %self.people%
  while ("%nextplr%" != "")
    wreward %nextplr% mana 5
    wsend %nextplr% Your mana increases!
  if (%nextplr.name% == "The Void")
    halt
  else
    set nextplr %nextplr.next_in_room%
  end
done
* end of script

Thank you kindly for your help Peter! Whohooo!

The reason to why the while.. doesn't work like it should in this case is
because %nextplr.next_in_room% doesn't return "" when it is done, does it?
It returns a carriage return, eh? So it will NEVER be "" will it?
Therefore, infinite loop (my oh my, does it eat CPU when writing errors to
the logfile! :])

I hope I didn't bother anybody by sending this email to the list.  Maybe it
should have gone to Peter personally, but I thought that some other people
might want the version that works too.

Kind Regards,
/Torgny


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT