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
Jeppie
Newbie


Joined: 07 Dec 2002
Posts: 3
Location: United Kingdom

PostPosted: Sat Dec 07, 2002 1:24 pm   

Using variables as triggers to colour lines
 
I'm using the 6.38beta version. What I'm trying to do is to have variable lists of friends, enemies, clanmates etc, and to have them displayed in different colours on screen. I just can't get the colours to work though. I've tried co, cw, color - everything. I've tried using @friend and {@friend} in the trigger line but still nothing. Most of the time there's no colour change at all, occasionally I get the colour digits displayed under the person's name. *sigh* Getting very frustrated now - can anyone help?
Jeppie

Jo
Reply with quote
Castaway
GURU


Joined: 10 Oct 2000
Posts: 793
Location: Swindon, England

PostPosted: Sat Dec 07, 2002 2:10 pm   
 
Doesn't this work?
#TRIGGER {@friend} {#CW blue}

Otherwise, please show examples of what you tried.

Lady C.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Dec 07, 2002 3:33 pm   
 
This works in 6.16. Enter it at the command line. If it doesn't work in 6.38, please report it in the BETA forum. Note that it needs 3 sets of {} around the pattern.

#VAR friend {Jeppie|Castaway|Lightbulb}
#TR {{{@friend}}} {#CW blue}

LightBulb
Senior Member
Reply with quote
Jeppie
Newbie


Joined: 07 Dec 2002
Posts: 3
Location: United Kingdom

PostPosted: Sat Dec 07, 2002 4:24 pm   
 
Thanks guys, this seems to have helped me progress towards a solution, but I am now getting the following error message:
Cannot locate msscript.ocx scripting object. Please download it from Microsoft.com to enable Microsoft Scripting in Zmud.
I've actually got msscript.ocx on my pc so maybe it's in the wrong directory? I went onto the Microsoft website and did a search on msscript.ocx but no results :( Anyone got any more bright ideas please?
Thanks for all your help
Jeppie

Jo
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Sat Dec 07, 2002 4:45 pm   
 
quote:

Thanks guys, this seems to have helped me progress towards a solution, but I am now getting the following error message:
Cannot locate msscript.ocx scripting object. Please download it from Microsoft.com to enable Microsoft Scripting in Zmud.
I've actually got msscript.ocx on my pc so maybe it's in the wrong directory? I went onto the Microsoft website and did a search on msscript.ocx but no results :( Anyone got any more bright ideas please?
Thanks for all your help
Jeppie

Jo



I suspect that msscript.ocx is not registered properly.



Check out MSKB article 184739 for information on downloading msscript.ocx (if yours is somehow corrupted) and registering it manually with regsvr32 (more info on regsvr32 available in 249873).

If that doesn't work, you might have a problem similar to that described in
289493.

Hope that helps...

 - Charbal
Reply with quote
diasflac
Newbie


Joined: 26 Nov 2002
Posts: 3

PostPosted: Sun Dec 08, 2002 9:34 am   
 
quote:

This works in 6.16. Enter it at the command line. If it doesn't work in 6.38, please report it in the BETA forum. Note that it needs 3 sets of {} around the pattern.

#VAR friend {Jeppie|Castaway|Lightbulb}
#TR {{{@friend}}} {#CW blue}

LightBulb
Senior Member



I don't understand, why do you need 3 {'s? Thanks in advance.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Dec 08, 2002 9:44 am   
 
Because it works.

LightBulb
Senior Member
Reply with quote
diasflac
Newbie


Joined: 26 Nov 2002
Posts: 3

PostPosted: Sun Dec 08, 2002 10:20 am   
 
...but why does it work? why wouldn't 1 {} work?
Reply with quote
Castaway
GURU


Joined: 10 Oct 2000
Posts: 793
Location: Swindon, England

PostPosted: Sun Dec 08, 2002 12:24 pm   
 
I must confess to being confused..
I haven't used string-list triggers in a while, and have just tried the follwing:
#VAR friends {Peng|Sonne|Grey}
#TRIGGER {@friends} {#CW blue}
without success. Then I tried it with more brackets (no idea why that should help), also no sucess..
A simple trigger like:
#TRIGGER {Peng} {say hi}
works perfectly..

So is it 6.38, or is it me?

Lady C. *confused*
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Sun Dec 08, 2002 12:34 pm   
 
#VAR {friends} {seamer|jeppie|castaway|"someone else"}
#ACT {@friends} {#cw %1 red,bright}

this works fine for me
the "" around someone else is useful if the mud uses first and surname for interaction (ie Seamer Kedaire gossips/tells you/slaps you)

Why oh WHY did I have pass door on...
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Dec 08, 2002 2:35 pm   
 
Ok, lets set a couple of things straight. First of all, the correct syntax is:
#TRIGGER {{@friend}} {#CW blue}

When you surround somthing with {}'s in a pattern you are specifying one of two things:
  • If the first character is a ^, then the trigger is to match anything that is not the string enclosed in the curly braces (without the ^)

  • Otherwise, the curly braces contain a stringlist and the trigger will match any of the items in the stringlist


  • The second case is what we want, but instead of manually writing the stringlist in the pattern, we want a dynamic variable. Thus, if the pattern would normally be:
    {Jeppie|Castaway|Lightbulb}

    then, replacing it with a variable, it becomes:
    {@friend}

    The second pair of curly braces are there just because the syntax of the #TRIGGER command requires curly braces around the whole pattern of the trigger. Since the pattern is:
    {@friend}

    we end up with double curly braces when using the #TRIGGER command.

    Now, I don't know if zMUD 6.16 needs a third set of curly braces or not. I can't confirm it since I don't have 6.16 installed, but it seems like a pretty big bug to me if it does need them. I'll take LightBulb's word for it that it does need them, but people should keep in mind then the correct syntax.

    I can, however, confirm that in 6.38 the correct syntax does work and neither of the other two (one set of curly braces or three set of curly braces) work.

    Next, Jeppie, you should follow the instructions thet Charbal mentioned for getting msscript.ocx installed properly. However, to use this trigger, you shouldn't need to do that at all. That file is only necessary if you are going to use VBScript or JScript to code your scripts in zMUD. However, the trigger provided here is in neither of these two languages, but in zMUD's own propietary script language, which we call zScript.

    Furthermore, you should have only gotten that message if you went into the settings editor and in the Edit Window of one of the settings you cliked in either the VBScript or JScript tab. You shouldn't need to do this to create the trigger provided since the trigger was posted in such a way that you can just copy and paste it into the zMUD command line and press Enter.

    So, in summary, if you are using 6.38, this is the trigger you need:
    #TRIGGER {{@friend}} {#CW blue}

    You just need to copy and paste this directly into the zMUD command line. Finally, you must make sure that the variable @friend exists, that it is a stringlist and that each item in the stringlist is the name of one of your friends.

    Kjata
    Reply with quote
    LightBulb
    MASTER


    Joined: 28 Nov 2000
    Posts: 4817
    Location: USA

    PostPosted: Sun Dec 08, 2002 5:45 pm   
     
    Kjata is correct that the correct syntax should be two sets of braces. However, my own experience, confirmed by frequent testing (including this thread), is that two don't work but three do. This is not the first time I've mentioned it.

    Whenever experience (three braces) conflicts with theory (two braces), I follow the scientific method: If the data conflicts with the theory, throw out the theory not the data. Thus my answer, "because it works".

    LightBulb
    Senior Member
    Reply with quote
    Jeppie
    Newbie


    Joined: 07 Dec 2002
    Posts: 3
    Location: United Kingdom

    PostPosted: Mon Dec 09, 2002 3:07 pm   
     
    Hello again. Got everything working now, thanks a million for all your help :)
    Jeppie

    Jo
    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