RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2.0 RC1] Player AlarmClock Reminder

Ashlar

Sorceror
Player AlarmClock Reminder

This allows players to send themselves reminders in-game.

The player recieves a gump that allows them to input a message ( up to 36-ish characters ) as a quick note and the number of minutes in which they want to be reminded.

The time is grabbed as a double, allowing times that are in seconds also ( e.g. 1.5 = 1 minute 30 sec).

When the time has elapsed, the code checks to see if the player is still in-game before sending the second gump.
( No crashy crashy ;) )
The second gump that is attention grabbing, but somewhat see-throughable to hopefully avoid death if the player was in battle.

This second gump allows a "snooze" feature to resend the gump again later.

There are now two versions of this script.
One activates with the command [RemindMe and the other is an item [add ReminderAlarmClock
Both of these versions will work at the same time on the same server, so if you want to reserver the command version for staff use, just change the accesslevel requirement to AccessLevel.GameMaster

Feedback/Improvements welcome of course! :p
 

Attachments

  • Player AlarmClock Reminder.zip
    3.2 KB · Views: 222
  • ItemVersionReminderTimer.zip
    5.6 KB · Views: 177

Tee312

Wanderer
was looking very forward to this script/system after i seen your post of what your working on! Glad to see it was first :) now to wait for mountain climbing :p great job ashlar, installing it now :)
 

Aeolus

Sorceror
This is a great idea Ashlar! Thanks to Aliens gump tutorial, I just recently learned a little bit about gumps and customizing this for my shard was a good practice project for me! I'll add my version here too so people can have a choice (choices are good!) I changed the gumps (and their placement) and the comand to [Reminder instead of [RemindMe. Both gumps will appear in the upper left-hand corner. If you use the same GM Toolbar as me (not sure who wrote it, but it's the one with all the "Okay" buttons) it will appear directly below that. I would include a screenshot, but I'm currently without screenshot software- sorry! I take no credit for this script whatsoever- it is Ashlar's all the way, I just customized it for my purposes and offer it as an alternative to his original.
 

Attachments

  • PlayerAlarmClockReminder.zip
    2.9 KB · Views: 67

Aeolus

Sorceror
Thanks for the info, Tee312. Can't believe I didn't know that before... I feel like a tool;) Anyway, here are the screenshots...

 

Tee312

Wanderer
hehe, no problem :) i would also suggest razor, unless u got something against it :p it has a good screenshot taker, that what i use for my ingame screenshots hehe.
 

daat99

Moderator
Staff member
Ashlar said:
This allows players to send themselves reminders in-game.

The player recieves a gump that allows them to input a message ( up to 36-ish characters ) as a quick note and the number of minutes in which they want to be reminded.

The time is grabbed as a double, allowing times that are in seconds also ( e.g. 1.5 = 1 minute 30 sec).

When the time has elapsed, the code checks to see if the player is still in-game before sending the second gump.
( No crashy crashy ;) )
The second gump that is attention grabbing, but somewhat see-throughable to hopefully avoid death if the player was in battle.

This second gump allows a "snooze" feature to resend the gump again later.

There are now two versions of this script.
One activates with the command [RemindMe and the other is an item [add ReminderAlarmClock
Both of these versions will work at the same time on the same server, so if you want to reserver the command version for staff use, just change the accesslevel requirement to AccessLevel.GameMaster

Feedback/Improvements welcome of course! :p
That's a realy good idea there :)
You keep amaze me all the time :)

Now a couple of suggestions (feel free to ignore them all):
1. You could make 1 timer that hold a sorted (by RemindMe time) array of "player, message, time" and than in the OnTick method just check if the first entry in the array time is up or not, if so than send the player the alarm :)
1. extra: when you add a new reminder than you need to add it to the array in sorted.

2. (can be combined with 1) You can make the alarm timer switch delay times on tick.
Acording to your code if I want to be reminded of something in 2.01 (2 minutes and 1 second) than it'll send me the gump in 3 minutes (2.01>2->delay=1, tick1:1, tick2:2, tick3:3->remind).
I would make it just stop the timer and start a new timer with shorter delay when you cross the 30 seconds barrier :)


Anyway great job as always, keep this up :)


P.S.
Those suggestions are based on theory, not practice.
 

Ashlar

Sorceror
Update: New item based version available.

Aeolus- Alternatives are always good :) Thanks for caring enough about this script to add to it!

I just wanted to let everyone know that i finished the item based version of this script.
I had said that i was going to finish it that same night that i released the original, but real life interfered in those plans and put me behind.

I apoligise to you all for the delay, but i put my family before scripting and wouldn't have it any other way.

Edit: I just re-read what i typed.
I just want to clarify that everything is as fine as things usually are here.
The delay was caused by family togetherness times. :D

The item based version has two constructables in it.
One is just the base item with the MaxReminders set at 5 and the MaxMinutesPerReminder at 480. ( 8 hours )
The other allows you to chose those values in the constructable
i.e. [add ReminderAlarmClock 50 10
Would create a ReminderAlarmClock that has 50 concurrent reminders and a max of 10 minutes into the future per reminder.

I was hoping to add support for clearing active ReminderTimers, but i haven't yet figured out how to 'find' a timer once it has been activated... Still looking, but not really hard atm due to other projects.
If anyone wants to help... :)

Also:
My wife has been getting some questions about if i would mind people changing scripts that i have released.
The answer is:
Go for it!
Since i do not script for any particular shard, I consider everything i have done to be script fodder.
Everyone has permission to do anything wanted or desired to any and all scripts i have created.
( depending on my mood i might laugh or get miffed if you just change one thing and call it your own creation though )

Now, to finish updating the CrazyHue stuff....:eek:
 

Ashlar

Sorceror
daat99 said:
Now a couple of suggestions (feel free to ignore them all):
1. You could make 1 timer that hold a sorted (by RemindMe time) array of "player, message, time" and than in the OnTick method just check if the first entry in the array time is up or not, if so than send the player the alarm :)
1. extra: when you add a new reminder than you need to add it to the array in sorted.

2. (can be combined with 1) You can make the alarm timer switch delay times on tick.
Acording to your code if I want to be reminded of something in 2.01 (2 minutes and 1 second) than it'll send me the gump in 3 minutes (2.01>2->delay=1, tick1:1, tick2:2, tick3:3->remind).
I would make it just stop the timer and start a new timer with shorter delay when you cross the 30 seconds barrier :)

Lol, it took me longer to write my update post than it took you to figure it all out:p

I never even noticed the problem that you found in 2. (timer accuracy) sigh!

I did think of an array to hold the reminders, though it was for the intention of allowing a player to clear them.
I haven't yet figured out how to do it.
I know a timer is a class just like any item, but I have yet to figure out how to access it once it is started.
It isn't an item that i can just add a contextmenu to or a new doubleclick method or anything i can get my fingers on...
From reading Serialization.cs and Timers.cs (core), I don't see that timers are serialized, heck a timer feels less real to me than a map tile!

I am thinking of making some tools to help me find them and understand them better, but since i released my project list, i have been feeling a bit of pressure to get them done instead of adding new ones. (not from the community, but from myself)

On the other hand, since i am working on so many things, there is a good chance that i will run across something sooner rather than later.

Thanks for the kudos and the suggestions!
The suggestions are exactly what these scripts are needing!

Now to impliment them....:eek:
 

daat99

Moderator
Staff member
Ashlar said:
Lol, it took me longer to write my update post than it took you to figure it all out:p

I never even noticed the problem that you found in 2. (timer accuracy) sigh!

I did think of an array to hold the reminders, though it was for the intention of allowing a player to clear them.
I haven't yet figured out how to do it.
I know a timer is a class just like any item, but I have yet to figure out how to access it once it is started.
It isn't an item that i can just add a contextmenu to or a new doubleclick method or anything i can get my fingers on...
From reading Serialization.cs and Timers.cs (core), I don't see that timers are serialized, heck a timer feels less real to me than a map tile!

I am thinking of making some tools to help me find them and understand them better, but since i released my project list, i have been feeling a bit of pressure to get them done instead of adding new ones. (not from the community, but from myself)

On the other hand, since i am working on so many things, there is a good chance that i will run across something sooner rather than later.

Thanks for the kudos and the suggestions!
The suggestions are exactly what these scripts are needing!

Now to impliment them....:eek:
If you going to use 1 timer and array of reminders than you could always add a static timer variable to your script and just start/stop it:

ReminderTimer:
Code:
ReminderTimer static MyOnlyTimer; 
/* will add a static timer (1 only) to the server */

RemindMeGump:
Code:
ReminderTimer.MyOnlyTimer = new ReminderTimer( from, remindDelay, message ); 
/* will set a new timer in the static timer, you should check if it's 
    null or not first though, if it isn't null than add the new reminder 
    to the array, if it is null than create the new timer and add the 
    reminder to the array */

Keep in mind that this code wasn't tested and to be considered psedu code.
 

David

Moderate
Nice idea! I have not yet downloaded the script, but I intend to. One thought comes to mind... Consider checking to see if the Player is in combat mode--if so send a red system message or two and delay the gump.
 
Top