Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts
CuMorrigu
Beginner


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

PostPosted: Mon May 15, 2006 8:47 pm   

Script to do maintence on your Friend List on Temporal Rifts
 
This script seems to finally be working.

When you type in 'friendcheck' it will check your list of friends on the mud and remove any character that has been deleted or has not logged in more than 30 days (our mud deletes character after 30 days of inactivity)

This script was designed for Temporal Rifts (http://www.temporal-rifts.org/) (telnet://www.temporal-rifts.org:7887)

If you can see a better or easier way to do this let me know...this was basically my first 'real' 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 {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 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
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts 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