Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
sorry for not including more code, i'll put that in now
the code given by wiredcode.com (the one that only has 1 line work, that i cant figure out) was given and is:

-----------------------------------------------------------

Screenname: SCREENNAME;
Password: PASSWORD;
Message;
Hello|Hi|Hey=exact>Hi! How are you?|Hello!;
Are you=>Yep.|Probably.|I dunno.|Nah.;
/Message;
Connect;


-----------------------------------------------------------

now the main perl one that i would want to enter the responses into is called on_im.pl, and it shows and area to enter the responses (if not a command), but i dont know what to put in or how. heres that code

-----------------------------------------------------------
################################
# WIRED BOTS
#
# on_im();
#
# desc: This sub is called when the bot recieves an IM.
# It first grabs AIM default vars.
# Then filters those vars
# Then checks to see if $victim is an idiot
# Then Checks to see if $msg is a command
# If not a command && not an idiot:
# It replies via the custom code (or command sub)
# Then logs the IM
# Then sleeps and sends
#
# recv: AIM's vars w/ $victim, $friend, and $msg as args.
# sends: either a warning, or a message.
################################

sub on_im {


($aim, $evt, $from, $to) = @_;
$args = $evt->args();
($victim, $friend, $msg) = @$args;

#filter $victim, make it lower case and remove spaces
$victim = lc($victim);
$victim =~ s/ //g;

# This Code creates formats $msg the way you (should) want it, without HTML.
$msg =~ s/<(.|\n)+?>//g;


#check against IDIOT LIST
my $idiot = idiots("$victim");


#if an idiot, warn and block him
if ($idiot != 1) {
#otherwise, continue


#check msg vs. list of commands.. call the commands sub
($isacommand,$reply) = commands($victim,$msg);

#if not a command..
if ($isacommand != 1) {
#custom code
#put what you want your bot to do here.
#its better to put it in a sub, so you can edit it later
easily.
#right now its set up to grab a thought from my database
$reply = thought();

#end custom code
}

#LOG this IM..

log_im($victim,$msg,$screenname,$reply);

#SLEEP & SEND!
sleep(dosleep(1,3));
$aim->send_im($victim, "$reply");
#print that the sleep is done..
print " done.\n\n";

}
}

1;

-----------------------------------------------------------
now it also says i could put it in a sub file, so that it would be easier to edit. if i were to, how would i do this?

thanks alot for your help and please respond and email responses to aimbot1@hotmail.com

In reply to Re: im bot text responses by Anonymous Monk
in thread im bot text responses by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-20 08:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found