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
CuMorrigu
Beginner


Joined: 29 Jul 2004
Posts: 19
Location: United States

PostPosted: Thu May 04, 2006 4:47 am   

Multi-line Capture for Housekeeping
 
All,

I've done some digging, but maybe just not enough.

The MUD I play has a friend channel. You are allowed up to 50 people on this list. Somtimes it can get kind of hard to keep up with. Rather than manually go through and check each player on the list I'm trying to come up with a script that will do the following:

I chose 'friendcheck' for my trigger.

Upon that It should then...

Check the current system time, perform a friend list:

#say At the sound of the tone the time will be %time
friend list

The output for the say looks something like this:

At the sound of the tone the time will be Wednesday May 3, 2006 11:36:52 pm

there is then a command to assign the following variables:

trigger - At the sound of the tone the time will be %1 %2 %3, %4 %5:%6:%7 %8

currentday = %1
currentmonth = %2
currentdate = %3
currentyear = %4
currenthour = %5
currentminute = %6
currentsecond = %7
currentampm = %8

The friend list output looks something like this:

Friend Hears your FChat by default?
=================================
Khale Yes
Mariposa Yes
Andemil Yes
Finny Yes
Marco Yes
Nivtu Yes
Phiala Yes
Ordici Yes
Badmoon Yes
Zin Yes
Maeve Yes
Xiphen Yes
Aiea Yes
Arildah Yes
Emiko Yes
Iiannya Yes
Emphesys Yes
Cleaver Yes
Magus Yes
Zarai Yes
Kedawin Yes
Kentigern Yes
Artimis Yes
Doofer Yes
Scorn Yes
Feanaro Yes
Pelinor Yes
Bogart Yes
Urzogg Yes

That information is funneled into the following:

Trigger - %1%sYes

laston %1
#ga

This is one are where I start to encounter problems and think i need the multi-line capture. I get spammed out at this point.

The information from the laston looks like this:

Zarai was last here on Wed May 3 15:49:24 2006

That information is funneled into the folloiwng:

trigger - %1 was last here on %2 %3 %4 %5:%6:%7 %8

person = %1
lastday = %2
lastmonth = %3
lastdate = %4
lasthour = %5
lastminute = %6
lastsecond = %7
lastyear = %8

Okay, now what it should do from this point is compare the current time with the laston time and if the laston is more than 30 day it should do a friend remove.

I know there has got to be an easier way to do this than the way I am going about it so far.

Any help would be greatly appreciated.
Reply with quote
Arcane_of_Discworld
Wanderer


Joined: 29 Jan 2002
Posts: 99
Location: UK

PostPosted: Thu May 04, 2006 9:18 am   
 
Is there really any need to capture/analyse the full date and time? I would think that it would be a much simpler process to only capture/analyse Day, Month and Year. To simplify it even further I would test for one month periods instead of the 30 days you specified, this would mean that your friendscheck process would discard old friends who haven't been on for between 28 and 31 days depending on the month.

I notice also that there does not seem to be any pattern by which to test the completion of the 'Friend Hears your FChat by default?' pattern matching... could I recommend that you issue another command, after the one which begins the listing of your friends, by which completion can be determined (the output from the second command should definatly fit onto one line for ease of use). To be of any help I believe you need to answer the following questions:

What is the command to initiate the collection of a list of friends?
What is the second command that can be used to ascertain completion of the first command?
What is an example of the mud output from the secondary command?
Reply with quote
CuMorrigu
Beginner


Joined: 29 Jul 2004
Posts: 19
Location: United States

PostPosted: Thu May 04, 2006 3:06 pm   Multi-line Capture for Housekeeping
 
Quote:
What is the command to initiate the collection of a list of friends?
'friend list' (without the tickmarks) will display the list of friends

Quote:
What is the second command that can be used to ascertain completion of the first command?
There is no real command that I can think of. When it is done it displays my prompt. That currently looks like:

235697/235697hp 116149/116149m 56515/56515mv 3800/3800en Shezrai 1,780,480,537GP 450,248SP
The Village (zone) Cumorrigu's Home (room) -300 (Align) NE(S)(W) (s)

And of course that will vary depending on what my various stats are at the time and where in the mud I am.
Reply with quote
Arcane_of_Discworld
Wanderer


Joined: 29 Jan 2002
Posts: 99
Location: UK

PostPosted: Thu May 04, 2006 8:34 pm   
 
Your prompt is scary for someone not accustomed to even having one (LPMud), I wouldn't be triggering off of that. As there is nothing by which to confirm the initial data collection as finalised I would use progressive alarms instead issuing the 'laston [whoever]' commands in one second increments.

Just a few more questions for you, in your original post you gave 'Zarai was last here on Wed May 3 15:49:24 2006' as an example for the response to a 'laston' command, are the full month names used or are the abbreviated to 3 letters?

What is the syntax for removing somone from your friends list?
Reply with quote
CuMorrigu
Beginner


Joined: 29 Jul 2004
Posts: 19
Location: United States

PostPosted: Thu May 04, 2006 10:43 pm   
 
Okay,

I've been working on it some more and that is below, but first let me answer your questions:

Quote:

are the full month names used or are the abbreviated to 3 letters?

The months are abbreviated to three letters.

Quote:

What is the syntax for removing somone from your friends list?

friend remove 'name' is the syntax.

I still get spammed off if I try to do a 'laston' off of the 'friend list'. I tried putting a #wait in there for 5 seconds and that didn't seem to help any. Right now I've also got all the output from the 'friend list' command gagged and that didn't help any either. It is just too much info to fast.

The script below seems to work hit or miss. Sometimes it will gather the info sometimes it won't. I can never get it to remove the person, it won't expand the variable.

I appreciate all the help


#CLASS {friendchat}
#TRIGGER {%1%sYes} {#ga;laston %1;#ga} "" {disable}
#TRIGGER {%1 was last here on %2 %3 %4 %5:%6:%7 %8} {person = %1;lastday = %2;monthword = %3;lastdate = %4;lasthour = %5;lastminute = %6;lastsecond = %7;lastyear = %8;#if {monthword=Jan} {currentmonth=1};#if {monthword=Feb} {currentmonth=2};#if {monthword=Mar} {currentmonth=3};#if {monthword=Apr} {currentmonth=4};#if {monthword=May} {currentmonth=5};#if {monthword=Jun} {currentmonth=6};#if {monthword=Jul} {currentmonth=7};#if {monthword=Aug} {currentmonth=8};#if {monthword=Sep} {currentmonth=9};#if {monthword=Oct} {currentmonth=10};#if {monthword=Nov} {currentmonth=11};#if {monthword=Dec} {currentmonth=12};#math monthdifference @currentmonth-@lastmonth;#if monthdifference<1 {friend remove @person}}
#TRIGGER {At the sound of the tone the time will be %2/%3/%4 %5:%6:%7 %8} {currentmonth = %2;currentdate = %3;currentyear = %4;currenthour = %5;currentminute = %6;currentsecond = %7;currentampm = %8}
#TRIGGER {friendcheck} {#say At the sound of the tone the time will be %time( c);friend list;#ga}
#TRIGGER {Friend%sHears your FChat by default?} {#ga}
#TRIGGER {=================================} {#ga}
#CLASS 0
Reply with quote
Arcane_of_Discworld
Wanderer


Joined: 29 Jan 2002
Posts: 99
Location: UK

PostPosted: Thu May 04, 2006 11:11 pm   
 
Here is my code to do the entire process, just copy and paste it into your command line then hit enter. It will create the classes 'Friends' and 'Friends|Check'. The Friends class contains only the initiating alias and is always active, the Check class within it has two triggers and several variables, this folder is only active when processing. You may need to disable your own script in order to test this one.

Code:
#alias friendcheck {#T+ {Friends|Check};#variable CurrentDay {%char(37)time(dd)} {%char(37)null()} {Friends|Check};#variable CurrentMonth {%char(37)time(mm)} {%char(37)null()} {Friends|Check};#variable CurrentYear {%char(37)time(yyyy)} {%char(37)null()} {Friends|Check};#echo Assigned variables: 'CurrentDay' to %char(64)CurrentDay, 'CurrentMonth' to %char(64)CurrentMonth and 'CurrentYear' to %char(64)CurrentYear.;#var CutOffDay {%char(64)CurrentDay} {%char(37)null()} {Friends|Check};#if (%char(64)CurrentMonth=01) {#var CutOffMonth {12} {%char(37)null()} {Friends|Check};#math CutOffYear (%char(64)CurrentYear-1) {Friends|Check}} {#math CutOffMonth (%char(64)CurrentMonth-1) {Friends|Check};#var CutOffYear {%char(64)CurrentYear} {%char(37)null()} {Friends|Check}};#echo Friends who have not logged in since %char(64)CutOffDay/%char(64)CutOffMonth/%char(64)CutOffYear will be removed from your friends list.;#var Counter {5} {5} {Friends|Check};friend list} Friends
#trigger {^(%w)%sYes$} {#gag;#var TempFriend {%char(37)1} {%char(37)null} {Friends|Check};#alarm +%char(64)Counter {#send {laston %char(64)TempFriend}};#add Counter 1} {Friends|Check}
#var Months {Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec} {Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec} {Friends|Check}
#trigger {^(%w) was last here on %w ({@Months}) (%n) * (%n)$} {#gag;#IF (%4>%char(64)CutOffYear) {#ECHO %1 is staying a friend.} {#IF (%char(37)ismember( %2, %char(64)Months)=%char(64)CutOffMonth AND %3>=%char(64)CutOffDay AND %4=%char(64)CutOffYear) {#ECHO %1 is staying a friend.} {#IF (%char(37)ismember( %2, %char(64)Months)>%char(64)CutOffMonth AND %4=%char(64)CutOffYear) {#ECHO %1 is staying a friend.} {#ECHO %1 has been removed from my Friends list.;#SEND {friend remove %1}}}};#IF (%1=%char(64)TempFriend) {#ECHO Friends check has completed.;#ALARM +2 {#T- {Friends|Check}}}} {Friends|check}
#T- {Friends|Check}


Don't worry how it looks in the box above as I have had to use several %char() functions in order to make the resultant triggers, aliases and variables behave themselves. You may also have to adjust the two trigger's pattern so it works properly as I did not have access to the mud your on to test them out. I have gagged what i thought appropriate however you may also want to gag your prompt for the duration of the script as sending up to 50 commands (total number of friends) will probably generate a lot of prompts, to do so simply add the trigger to the nested 'Check' class.

Let me know if it works.
Reply with quote
CuMorrigu
Beginner


Joined: 29 Jul 2004
Posts: 19
Location: United States

PostPosted: Thu May 04, 2006 11:51 pm   
 
Nope...didn't work.

I have mine disabled this is what I got:

Quote:

235697/235697hp 116149/116149m 56515/56515mv 3800/3800en Shezrai 1,780,480,537GP 450,248SP
The Village (zone) Cumorrigu's Home (room) -300 (Align) NE(S)(W) (s)
Assigned variables: 'CurrentDay' to @CurrentDay, 'CurrentMonth' to @CurrentMonth and 'CurrentYear' to @CurrentYear.
Friends who have not logged in since @CutOffDay/@CutOffMonth/@CutOffYear will be removed from your friends list.
friend list
Friend Hears your FChat by default?
=================================
Khale Yes
Mariposa Yes
Andemil Yes
Finny Yes
Marco Yes
Nivtu Yes
Phiala Yes
Ordici Yes
Badmoon Yes
Zin Yes
Maeve Yes
Xiphen Yes
Aiea Yes
Arildah Yes
Emiko Yes
Iiannya Yes
Emphesys Yes
Cleaver Yes
Magus Yes
Zarai Yes
Kedawin Yes
Kentigern Yes
Artimis Yes
Doofer Yes
Scorn Yes
Feanaro Yes
Pelinor Yes
Bogart Yes
Urzogg Yes


I've reworked my code a bit and got it down so that it will do the 'laston' command without spamming me out, but it still doesn't seem to do the math.

Code:
#CLASS {friendchat}
#TRIGGER {%1 was last here on %2 %3%s%4 %5:%6:%7 %8} {#ga;person = %1;lastday = %2;monthword = %3;lastdate = %4;lasthour = %5;lastminute = %6;lastsecond = %7;lastyear = %8;#if {monthword=Jan} {currentmonth=1};#if {monthword=Feb} {currentmonth=2};#if {monthword=Mar} {currentmonth=3};#if {monthword=Apr} {currentmonth=4};#if {monthword=May} {currentmonth=5};#if {monthword=Jun} {currentmonth=6};#if {monthword=Jul} {currentmonth=7};#if {monthword=Aug} {currentmonth=8};#if {monthword=Sep} {currentmonth=9};#if {monthword=Oct} {currentmonth=10};#if {monthword=Nov} {currentmonth=11};#if {monthword=Dec} {currentmonth=12};#math monthdifference @currentmonth-@lastmonth;#if monthdifference<1 {friend remove @person}}
#TRIGGER {Now that's a silly question.} {#ga}
#TRIGGER {At the sound of the tone the time will be %2/%3/%4 %5:%6:%7 %8} {currentmonth = %2;currentdate = %3;currentyear = %4;currenthour = %5;currentminute = %6;currentsecond = %7;currentampm = %8}
#TRIGGER {friendcheck} {#say At the sound of the tone the time will be %time( c);friend list;#ga}
#TRIGGER {Friend%sHears your FChat by default?} {#ga}
#TRIGGER {=================================} {#ga}
#TRIGGER {%1%sYes} {#ga;#loop 1 {laston %1;#ga}}
#CLASS 0


I'm going to look at yours and see what I can grab with mine. I do appreciate all the help. I know it's hard to do when you aren't on that mud.

If you want to check out the mud its temporal-rifts.org on port 7887

I'm Cumorrigu on there as well
Reply with quote
Arcane_of_Discworld
Wanderer


Joined: 29 Jan 2002
Posts: 99
Location: UK

PostPosted: Thu May 04, 2006 11:59 pm   
 
It looks like you have either disabled or changed the default variable character in 'Preferences'>'Special Characters' .. what is your default variable character?
Reply with quote
CuMorrigu
Beginner


Joined: 29 Jul 2004
Posts: 19
Location: United States

PostPosted: Fri May 05, 2006 12:05 am   
 
You're right...I did have the @ turned off.

I went back in and enabled it but it didn't seem to make much of a difference.

I got the following text:


Assigned variables: 'CurrentDay' to @CurrentDay, 'CurrentMonth' to @CurrentMonth and 'CurrentYear' to @CurrentYear.
Friends who have not logged in since @CutOffDay/@CutOffMonth/@CutOffYear will be removed from your friends list.
friend list
Friend Hears your FChat by default?
=================================
Reply with quote
Arcane_of_Discworld
Wanderer


Joined: 29 Jan 2002
Posts: 99
Location: UK

PostPosted: Fri May 05, 2006 12:12 am   
 
In that case it looks like the #T+ {Friends|Check} is not enabling the 'Check' class... try manually enabling it (right click on the class name and select 'enable' then try it again.

You might also have disabled/changed the Command char special character in Preferences>Special Characters.
Reply with quote
CuMorrigu
Beginner


Joined: 29 Jul 2004
Posts: 19
Location: United States

PostPosted: Fri May 05, 2006 12:25 am   
 
The Command Char special character was enabled

The Check class was already enabled

When I look at the following trigger:

^(%w) was last here on %w ({@Months}) (%n) * (%n)$

trigger

Zmud gives the following error:

#IF (%4>%char(64)CutOffYear) {#ECHO %1 is staying a friend.} {#IF (%char(37)ismember( %2, %char(64)Months)=%char(64)CutOffMonth AND %3>=%char(64)CutOffDay AND %4=%char(64)CutOffYear) {#ECHO %1 is staying a friend.} {#IF (%char(37)ismember( %2, %char(64)Months)>%char(64)CutOffMonth AND %4=%char(64)CutOffYear) {#ECHO %1 is staying a friend.} {#ECHO %1 has been removed from my Friends list.;#SEND {friend remove %1}}}};#IF (%1=%char(64)TempFriend) {#ECHO Friends check has completed.;#ALARM +2 {#T- {Friends|Check}}}
^ syntax error

(the above will only do you any good if you copy and paste it into notepad)
Reply with quote
Arcane_of_Discworld
Wanderer


Joined: 29 Jan 2002
Posts: 99
Location: UK

PostPosted: Fri May 05, 2006 12:36 am   
 
It looks like it hasn't transfered properly from the command line.. here is the Class script from the Friends Class:

Code:
#CLASS {Friends}
#ALIAS friendcheck {#T+ {Friends|Check}
   #VARIABLE CurrentDay {%time( dd)} {%null( )} {Friends|Check}
   #VARIABLE CurrentMonth {%time( mm)} {%null( )} {Friends|Check}
   #VARIABLE CurrentYear {%time( yyyy)} {%null( )} {Friends|Check}
   #ECHO Assigned variables: 'CurrentDay' to @CurrentDay, 'CurrentMonth' to @CurrentMonth and 'CurrentYear' to @CurrentYear.
   #VARIABLE CutOffDay {@CurrentDay} {%null( )} {Friends|Check}
   #IF (@CurrentMonth=01) {#VARIABLE CutOffMonth {12} {%null( )} {Friends|Check}
      #MATH CutOffYear (@CurrentYear-1) {Friends|Check}} {#MATH CutOffMonth (@CurrentMonth-1) {Friends|Check}
      #VARIABLE CutOffYear {@CurrentYear} {%null( )} {Friends|Check}}
   #ECHO Friends who have not logged in since @CutOffDay/@CutOffMonth/@CutOffYear will be removed from your friends list.
   #VARIABLE Counter {5} {5} {Friends|Check}
   friend list}
#CLASS 0
#CLASS {Friends|Check}
#VARIABLE Months {Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec} {Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec}
#TRIGGER {^(%w)%sYes$} {#GAG
   #VARIABLE TempFriend {%1} {%null} {Friends|Check}
   #ALARM +@Counter {#SEND {laston @TempFriend}}
   #ADD Counter 1}
#TRIGGER {^(%w) was last here on %w ({@Months}) (%n) * (%n)$} {#GAG
   #IF (%4>@CutOffYear) {#ECHO %1 is staying a friend.} {#IF (%ismember( %2, @Months)=@CutOffMonth AND %3>=@CutOffDay AND %4=@CutOffYear) {#ECHO %1 is staying a friend.} {#IF (%ismember( %2, @Months)>@CutOffMonth AND %4=@CutOffYear) {#ECHO %1 is staying a friend.} {#ECHO %1 has been removed from my Friends list.
            #SEND {friend remove %1}}}}
   #IF (%1=@TempFriend) {#ECHO Friends check has completed.
      #ALARM +2 {#T- {Friends|Check}}}}
#CLASS 0


Perhaps cutting and pasting the above into the script panel (overwriting what is already there) of the Friends class might do the trick.

Another thing that might be the problem is if you haven't got the Parameter Char set as '%' within Preferences>Special Characters.

I have all special characters enabled.
Reply with quote
CuMorrigu
Beginner


Joined: 29 Jul 2004
Posts: 19
Location: United States

PostPosted: Tue May 09, 2006 10:45 pm   Multi-line Capture for Housekeeping
 
Sorry it has taken me so long to get back *sigh* things at work picked up some, sick kids...blah. Anyway

I repasted the code into friends class as you suggested. It still doesn't seem to work. I get the following response from the mud:

Assigned variables: 'CurrentDay' to 09, 'CurrentMonth' to 05 and 'CurrentYear' to 2006.
Friends who have not logged in since 09/4/2006 will be removed from your friends list.
friend list
Friend Hears your FChat by default?
=================================

Then after a bit of a pause it scrolls repeatedly the laston for the last person in my 'friend list' output. An extra 12 times to be exact.

I did get my script to run once (the one I wrote) but something is wrong because what it did was remove everyone on my friendlist who was not currently online.

I will post my version in a bit...have to go get meds for the kiddos.[/code]
Reply with quote
CuMorrigu
Beginner


Joined: 29 Jul 2004
Posts: 19
Location: United States

PostPosted: Tue May 09, 2006 10:45 pm   Multi-line Capture for Housekeeping
 
Sorry it has taken me so long to get back *sigh* things at work picked up some, sick kids...blah. Anyway

I repasted the code into friends class as you suggested. It still doesn't seem to work. I get the following response from the mud:

Assigned variables: 'CurrentDay' to 09, 'CurrentMonth' to 05 and 'CurrentYear' to 2006.
Friends who have not logged in since 09/4/2006 will be removed from your friends list.
friend list
Friend Hears your FChat by default?
=================================

Then after a bit of a pause it scrolls repeatedly the laston for the last person in my 'friend list' output. An extra 12 times to be exact.

I did get my script to run once (the one I wrote) but something is wrong because what it did was remove everyone on my friendlist who was not currently online.

I will post my version in a bit...have to go get meds for the kiddos.
Reply with quote
CuMorrigu
Beginner


Joined: 29 Jul 2004
Posts: 19
Location: United States

PostPosted: Wed May 10, 2006 1:26 am   Multi-line Capture for Housekeeping
 
Okay...

Here is the code I have so far:

Code:
#CLASS {friendcheck}
#TRIGGER {friendcheck} {#say At the sound of the tone the time will be %time( c);#t+ check_triggers;friend list;#ga;#wa 120000;#t- check_triggers;#echo Done}
#CLASS 0
#CLASS {friendcheck|Check_Triggers}
#TRIGGER {%1 was last here on %2 %3%s%4 %5:%6:%7 %8} {#ga;#va person {%1} 1 Check_Variables;#va lastday {%2} 1 Check_Variables;#va monthword {%3} 1 Check_Variables;#va lastdate {%4} 1 Check_Variables;#va lasthour {%5} 1 Check_Variables;#va lastminute {%6} 1 Check_Variables;#va lastsecond {%7} 1 Check_Variables;#va lastyear {%8} 1 Check_Variables;#if (@monthword = Jan) {monthnum=1};#if (@monthword = Feb) {monthnum=2};#if (@monthword = Mar) {monthnum=3};#if (@monthword = Apr) {monthnum=4};#if (@monthword = May) {monthnum=5};#if (@monthword = Jun) {monthnum=6};#if (@monthword = Jul) {monthnum=7};#if (@monthword = Aug) {monthnum=8};#if (@monthword = Sep) {monthnum=9};#if (@monthword = Oct) {monthnum=10};#if (@monthword = Nov) {monthnum=11};#if (@monthword = Dec) {monthnum=12};#math @monthdifference (@currentmonth-@months);#if (@monthdifference>2) {friend remove @person;friend quit @person}}
#TRIGGER {Now that's a silly question.} {#ga}
#TRIGGER {At the sound of the tone the time will be %2/%3/%4 %5:%6:%7 %8} {#va currentmonth %2 1 Check_Variables;#va currentdate %3 1 Check_Variables;#va currentyear %4 1 Check_Variables;#va currenthour %5 1 Check_Variables;#va currentminute %6 1 Check_Variables;#va currentsecond %7 1 Check_Variables;#va currentampm %8 1 Check_Variables}
#TRIGGER {Friend%sHears your FChat by default?} {#ga}
#TRIGGER {=================================} {#ga}
#TRIGGER {%1%sYes} {#ga;#loop 1 {laston %1;#ga}}
#CLASS 0
#CLASS {friendcheck|Check_Variables}
#VAR person {1} {1}
#VAR currentdate {1} {1}
#VAR currentyear {1} {1}
#VAR currenthour {1} {1}
#VAR currentminute {1} {1}
#VAR currentsecond {1} {1}
#VAR currentampm {1} {1}
#VAR lastday {1} {1}
#VAR monthword {1} {1}
#VAR lastdate {1} {1}
#VAR lasthour {1} {1}
#VAR lastminute {1} {1}
#VAR lastsecond {1} {1}
#VAR lastyear {1} {1}
#VAR currentmonth {1} {1}
#VAR monthdifference {1} {1}
#CLASS 0


Like I said...this one will run, but it removes all of my friends that aren't online at the time.
Reply with quote
CuMorrigu
Beginner


Joined: 29 Jul 2004
Posts: 19
Location: United States

PostPosted: Mon May 15, 2006 8:01 pm   Trigger Problem **Solved** mostly
 
Okay,

I kept plugging away and got a little help from some people on the MUD...well one really.

The script works now (I think) the only way to really test it now is to wait until someone hasn't logged for a month on my friend list.

But it doesn't delete anyone else and it also removes non-existant people now.

The only thing left is to make it so that it only triggers if I type in the command. As it stands right now it will work even if someone sends you the command in a say or tell.

Code:
#CLASS {friendcheck}
#TRIGGER {fndchk} {#say At the sound of the tone the time will be %time( c);#t+ check_triggers;#gagon;friend list;#wa 15000;#gagoff;#t- check_triggers;#echo Done}
#CLASS 0
#CLASS {friendcheck|Check_Triggers}
#TRIGGER {((@person)) was last here on %2 %3%s%4 %5:%6:%7 %8} {#va lastday {%2} 1 Check_Variables;#va monthword {%3} 1 Check_Variables;#va lastdate {%4} 1 Check_Variables;#va lasthour {%5} 1 Check_Variables;#va lastminute {%6} 1 Check_Variables;#va lastsecond {%7} 1 Check_Variables;#va lastyear {%8} 1 Check_Variables;#if (@currentyear > @lastyear) {friend remove @person;friend quit@person;echo @person removed from Friends};#if ((@currentyear = @lastyear) and (@monthword = Jan)) {@monthnum = 1};#if ((@currentyear = @lastyear) and (@monthword = Feb)) {@monthnum = 2};#if ((@currentyear = @lastyear) and (@monthword = Mar)) {@monthnum = 3};#if ((@currentyear = @lastyear) and (@monthword = Apr)) {@monthnum = 4};#if ((@currentyear = @lastyear) and (@monthword = May)) {@monthnum = 5};#if ((@currentyear = @lastyear) and (@monthword = Jun)) {@monthnum = 6};#if ((@currentyear = @lastyear) and (@monthword = Jul)) {@monthnum = 7};#if ((@currentyear = @lastyear) and (@monthword = Aug)) {@monthnum = 8};#if ((@currentyear = @lastyear) and (@monthword = Sep)) {@monthnum = 9};#if ((@currentyear = @lastyear) and (@monthword = Oct)) {@monthnum = 10};#if ((@currentyear = @lastyear) and (@monthword = Nov)) {@monthnum = 11};#if ((@currentyear = @lastyear) and (@monthword = Dec)) {@monthnum = 12};#math @monthdifference (@currentmonth-@monthnum);#if (@monthdifference>1) {friend remove @person;friend quit @person;echo @person removed from Friends};#reset;#wa 3000}
#TRIGGER {Now that's a silly question.} {#ga} "" {disable}
#TRIGGER {At the sound of the tone the time will be %2/%3/%4 %5:%6:%7 %8} {#va currentmonth %2 1 Check_Variables;#va currentdate %3 1 Check_Variables;#va currentyear %4 1 Check_Variables;#va currenthour %5 1 Check_Variables;#va currentminute %6 1 Check_Variables;#va currentsecond %7 1 Check_Variables;#va currentampm %8 1 Check_Variables}
#TRIGGER {Friend%sHears your FChat by default?} {#ga} "" {disable}
#TRIGGER {=================================} {#ga} "" {disable}
#TRIGGER {%1%sYes} {#va person {%1} 1 Check_Variables;#loop 1 {laston %1;#ga}}
#TRIGGER {No player by that name exists.} {friend remove @person;friend quit @person}
#CLASS 0
#CLASS {friendcheck|Check_Variables}
#CLASS 0
Reply with quote
CuMorrigu
Beginner


Joined: 29 Jul 2004
Posts: 19
Location: United States

PostPosted: Mon May 15, 2006 8:40 pm   ***SOLVED***
 
Okay,

I think I've got it...It seems to work. If any of ya'll see a way to simplify this or do something better, let me know. This is basically my first script.

Code:
#CLASS {friendcheck}
#ALIAS friendcheck {#say At the sound of the tone the time will be %time( c);#t+ check_triggers;prompt;friend list;#ga;#wa 15000;#t- check_triggers;#echo Done;prompt}
#CLASS 0
#CLASS {friendcheck|Check_Triggers}
#TRIGGER {((@person)) was last here on %2 %3%s%4 %5:%6:%7 %8} {#va lastday {%2} 1 Check_Variables;#va monthword {%3} 1 Check_Variables;#va lastdate {%4} 1 Check_Variables;#va lasthour {%5} 1 Check_Variables;#va lastminute {%6} 1 Check_Variables;#va lastsecond {%7} 1 Check_Variables;#va lastyear {%8} 1 Check_Variables;#if (@currentyear > @lastyear) {friend remove @person;friend quit@person;echo @person removed from Friends};#if ((@currentyear = @lastyear) and (@monthword = Jan)) {@monthnum = 1};#if ((@currentyear = @lastyear) and (@monthword = Feb)) {@monthnum = 2};#if ((@currentyear = @lastyear) and (@monthword = Mar)) {@monthnum = 3};#if ((@currentyear = @lastyear) and (@monthword = Apr)) {@monthnum = 4};#if ((@currentyear = @lastyear) and (@monthword = May)) {@monthnum = 5};#if ((@currentyear = @lastyear) and (@monthword = Jun)) {@monthnum = 6};#if ((@currentyear = @lastyear) and (@monthword = Jul)) {@monthnum = 7};#if ((@currentyear = @lastyear) and (@monthword = Aug)) {@monthnum = 8};#if ((@currentyear = @lastyear) and (@monthword = Sep)) {@monthnum = 9};#if ((@currentyear = @lastyear) and (@monthword = Oct)) {@monthnum = 10};#if ((@currentyear = @lastyear) and (@monthword = Nov)) {@monthnum = 11};#if ((@currentyear = @lastyear) and (@monthword = Dec)) {@monthnum = 12};#math @monthdifference (@currentmonth-@monthnum);#if (@monthdifference>1) {friend remove @person;friend quit @person;echo @person removed from Friends};#reset;#wa 3000}
#TRIGGER {Now that's a silly question.} {#ga}
#TRIGGER {At the sound of the tone the time will be %2/%3/%4 %5:%6:%7 %8} {#va currentmonth %2 1 Check_Variables;#va currentdate %3 1 Check_Variables;#va currentyear %4 1 Check_Variables;#va currenthour %5 1 Check_Variables;#va currentminute %6 1 Check_Variables;#va currentsecond %7 1 Check_Variables;#va currentampm %8 1 Check_Variables}
#TRIGGER {Friend%sHears your FChat by default?} {#ga}
#TRIGGER {=================================} {#ga} "" {disable}
#TRIGGER {%1%sYes} {#va person {%1} 1 Check_Variables;#loop 1 {laston %1;#ga}}
#TRIGGER {No player by that name exists.} {friend remove @person;friend quit @person}
#CLASS 0
#CLASS {friendcheck|Check_Variables}
#VAR person {Doofer} {1}
#VAR lastday {1} {1}
#VAR monthword {1} {1}
#VAR lastdate {1} {1}
#VAR lasthour {1} {1}
#VAR lastminute {1} {1}
#VAR lastsecond {1} {1}
#VAR lastyear {1} {1}
#VAR currentmonth {1} {1}
#VAR currentdate {1} {1}
#VAR currentyear {1} {1}
#VAR currenthour {1} {1}
#VAR currentminute {1} {1}
#VAR currentsecond {1} {1}
#VAR currentampm {1} {1}
#CLASS 0
Reply with quote
Andemil
Newbie


Joined: 04 Jul 2006
Posts: 2

PostPosted: Tue Jul 04, 2006 7:02 pm   
 
that explains why you've been off chat for so long...
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