I have literally nothing as far as this function. This is a chat bot for a hopelessly obscure TTY-based chat system. Right now, it logs in, idles, and responds to specific commands as part of a loop. So far, I haven't had to make any of those responses depend on a particular part of the command. This function will be the instruction to move the bot to another room. If this were IRC, it'd be so much easier.
Essentially, the bot will see as text in the room "kimiko, go to " (the bot's account name is kimiko), and the word immediately following the space after 'to' will be the room name. I want the script to use "kimiko, go to " as the trigger (expect "kimiko, go to ") and the action to be to capture the following word.
This is part of the main loop. I left some of the functions in so you can see how it operates. The changing room thing basically has me scratching my head completely. I know how to make it look for the trigger phrase. I don't know how to initiate capturing the next word after the trigger phrase.
I'm just getting started to lean C and I'm using Ubuntu today I found a tutorial at this site: http://einstein.drexel.edu/courses/CompPhys/General/C_basics/c_tutorial.html and I got an error after compiling the fist code:
#include < stdio.h>
void main()
{
printf("\nHello World\n");
} ... (9 Replies)
Ok here is the deal, I have a command given to me by some systems guy who I cannot get ahold of on the weekend without paying him alot of money to help me. I need to get this done before Monday as I am just getting pummeled by DOS attacks. The comand given was....
netstat -ntu | awk '{print... (1 Reply)
I have a file with 3 digit numbers in it formatted as such:
123
065
321
How would I go about seeing if each number is less than 100 and if so outputting it to another file
Yes, I am a bit of a noob. I have tried with grep but I don't think it'll work.
Any general direction would be... (6 Replies)
Hello to all...this is my first post (so please go easy). :)
I feel pretty solid at expect scripting, but I'm running into an issue that I'm not able to wrap my head around. I wrote a script that is a little advanced for logging into a remote Linux machine and changing text in a file using sed.... (2 Replies)
Hello everyone.
i work in a school and i ran into an application today that is a real pickle. i know how to make it work, but i would need to script it. The way to make it work would be to have a script check each local user profile on login, see if the directory already exists, do nothing... (27 Replies)
Hi I'm pretty new to scripting and I've been googling around looking for an answer but have yet to come up with a proper solution. I work with multiple android devices at a time and I'm looking to simplify my life with a script. Basically I'm looking for a script that takes the device ID's and then... (2 Replies)
Hello. I'm attempting to create a shell script to assist me by saving time with one of my hobbies. I am an Android Enthusiast and currently build a few roms for one of the devices.
One of the roms I make is ported from a different device to mine (I get the original for the HTC Desire HD and... (3 Replies)
Hello,
I am new to shell scripting and i am trying to figure why is this not working with else statement.
I am searching for every directory in that DIR i am in, however the "else" seems to be triggered whenever the run the script..
Much thanks in advance!
#!/bin/shell
for item in... (3 Replies)
Hello,
I am in a Unix class and have been out of town. I have been tasked to generate a couple of scripts and ahve never done it before. I have a virtual machine running Ubuntu. The task is below
Prompt the system administrator for all valid input parameters
Generate a menu to ask which... (1 Reply)
Hello All,
I have a file of ip addresses called activeips.txt
What I'm trying to do is run a simple bash script that has a loop in it. The loop is a cat of the IP addresses in the file.
The goal is to run 2 nmap commands to give me outputs where each address in the list has an OS... (11 Replies)
Discussion started by: Dirk_Pitt
11 Replies
LEARN ABOUT DEBIAN
anyevent::xmpp::ext::muc::room
AnyEvent::XMPP::Ext::MUC::Room(3pm) User Contributed Perl Documentation AnyEvent::XMPP::Ext::MUC::Room(3pm)NAME
AnyEvent::XMPP::Ext::MUC::Room - Room class
SYNOPSIS DESCRIPTION
This module represents a room handle for a MUC.
METHODS
new (%args)
get_user ($nick)
This method returns the user with the $nick in the room.
get_me
This method returns the AnyEvent::XMPP::Ext::MUC::User object of yourself in the room. If will return undef if we are not in the room
anymore.
get_user_jid ($jid)
This method looks whether a user with the JID $jid exists in the room. That means whether the node and domain part of the JID match the
rooms node and domain part, and the resource part of the JID matches a joined nick.
get_users
This method returns the list of occupants as AnyEvent::XMPP::Ext::MUC::User objects.
make_instant ($cb)
If you just created a room you can create an instant room with this method instead of going through room configuration for a reserved
room.
If you want to create a reserved room instead don't forget to unset the "create_instant" argument of the "join_room" method of
AnyEvent::XMPP::Ext::MUC!
See also the "request_configuration" method below for the reserved room config.
$cb is the callback that will be called when the instant room creation is finished. If successful the first argument will be this room
object ($self), if unsuccessful the first argument will be undef and the second will be a AnyEvent::XMPP::Error::IQ object.
request_configuration ($cb)
This method requests the room configuration. When the configuration form or an error arrives $cb will be called. The first argument to
the callback will be a AnyEvent::XMPP::Ext::DataForm with the room configuration form or undef in case of an error. The second
argument will be a AnyEvent::XMPP::Error::MUC error object if an error occurred or undef if no error occurred.
If you made an answer form you can send it via the "send_configuration" method below.
Here is an example:
$room->request_configuration (sub {
my ($form, $err) = @_;
$form or return;
my $af = AnyEvent::XMPP::Ext::DataForm->new;
$af->make_answer_form ($form);
$af->set_field_value ('muc#roomconfig_maxusers', 20);
$af->clear_empty_fields;
$roomhdl->send_configuration ($af, sub {
# ...
});
});
"send_configuration ($answer_form, $cb)"
This method sends the answer form to a configuration request to the room. $answer_form should be a AnyEvent::XMPP::Ext::DataForm
object containig the answer form with the changed configuration.
The first argument of $cb will be a true value if the configuration change was successful. The second argument of $cb will be a
"AnyEvent::XMPP::Error::IQ" object if the configuration change was not successful.
make_message (%args)
This method constructs a AnyEvent::XMPP::Ext::MUC::Message with a connection to this room.
%args are further arguments for the constructor of AnyEvent::XMPP::Ext::MUC::Message. The default "to" argument for the message is the
room and the "type" will be 'groupchat'.
send_part ($msg, $cb, $timeout)
This lets you part the room, $msg is an optional part message and can be undef if no custom message should be generated.
$cb is called when we successfully left the room or after $timeout seconds. The default for $timeout is 60.
The first argument to the call of $cb will be undef if we successfully parted, or a true value when the timeout hit. Even if we
timeout we consider ourself parted (and a 'leave' event is generated).
users
Returns a list of AnyEvent::XMPP::Ext::MUC::User objects which are in this room.
jid Returns the bare JID of this room.
nick_jid
Returns the full JID of yourself in the room.
is_connected
Returns true if this room is still connected (but maybe not joined (yet)).
connection
If the room is still joined this method will return the connection on which the room is connected.
is_joined
Returns true if this room is still joined (and connected).
change_nick ($newnick)
This method lets you change your nickname in this room.
change_subject ($newsubject)
This methods changes the subject of the room.
AUTHOR
Robin Redeker, "<elmex at ta-sa.org>", JID: "<elmex at jabber.org>"
COPYRIGHT & LICENSE
Copyright 2007, 2008 Robin Redeker, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-01-23 AnyEvent::XMPP::Ext::MUC::Room(3pm)