 |
Pixar Newbie
Joined: 17 Apr 2005 Posts: 2
|
Posted: Sun Apr 17, 2005 8:24 pm
Storing names from a who is online check into a list |
I play an online game called Furcadia, and within Furcadia you can upload your own dream (a custom usermap). I would like to use a bot to check who enters and leaves that dream. I have set up a trigger that will do a 'who is online' check whenever someone enters or leaves. The check looks like this:
* Current players: Player1, Player2, Player3.
* 1382 total players online. Uptime 5 days 7:31
* Max players this session: 3622
* Max players today: 3622
* 3 players in this dream.
Is there a way to put the names into a list? I think I found the code to make the check if someone is added or removed from the list, but the main problem is getting that string into a list in the first place.
I tried to use this:
#AL qw {#VAR qw {};#T+ qw;~qw}
#TR {(*} Current players: %w, %w,} {#VAR qw {@qw %trigger}} {qw}
#TR {.$} {#T- qw;makelist} {qw}
#AL makelist {#LOOP %numwords("@qw", ", ") {#ADDITEM names {%word("@qw", %i, ", ")}}}
But that doesn't work...
I am an absolute beginner to this all, and I have no programming experience what so ever, so I do admit that I may be way over my head with all this. So I understand if you are reluctant to help. But I would appreciate it if anyone could tell me how to make this work, or at least point me into the right direction. So thank you in advance to anyone who is willing to help. |
|
|
 |
jessew Apprentice
Joined: 03 Mar 2003 Posts: 141
|
Posted: Sun Apr 17, 2005 11:19 pm |
Would this work?
#alias qw {#var qw "";#t+ "qw";~qw}
#trigger {~* Current players: (*).} {#var names %replace("%1",", ","|");#t- "qw"} "qw"
just substitute ", " with a pipe | , and instalist |
|
_________________ I love deadlines. I like the whooshing sound they make as they fly by. |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Apr 17, 2005 11:31 pm |
Quote: |
#AL qw {#VAR qw {};#T+ qw;~qw}
#TR {(*} Current players: %w, %w,} {#VAR qw {@qw %trigger}} {qw}
#TR {.$} {#T- qw;makelist} {qw}
#AL makelist {#LOOP %numwords("@qw", ", ") {#ADDITEM names {%word("@qw", %i, ", ")}}}
|
Delete everything quoted above, and create the following triggers. It will create the list for you, and should do so without any problems.
#trigger {command} {#T+ tWhoDream}
#trigger "tWhoDream" {~* Current players: (*).} {#variable qw %replace("%1",", ","|")`#T- tWhoDream}
The first trigger will turn on the trigger that captures the list, and that trigger will turn itself off so it doesn't accidentally match some other command's output. If you want to capture any of that other stuff, you will need to look into #CONDITIONs for the Current Players trigger or create new triggers.
As for adding/removing players, does it give any specific messaging? You could just trigger on that messaging and use #ADDITEM and #DELITEM to take them out of your list without doing a WHO command. |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
Pixar Newbie
Joined: 17 Apr 2005 Posts: 2
|
Posted: Mon Apr 18, 2005 3:01 pm |
Thank you for the help, it now works like a charm
The adding and removing I got working by modifying a script I found in an older post. The only problem was that there is a slight delay in giving the who command and the moment the list appears, making the trigger that does the actual check is executed even before the who list appears. But I put in a one second delay, so that way it works. There may be another way to get it working, but I will check on that when I get a bit more familiar with all the commands, as it already does what I want.
Again, thanks for helping me out! |
|
|
 |
|
|
|
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
|
|