User Control Panel
Advertisements

HELP US, HELP YOU!

Multiple "Questions" when "learning"

 
Post new topic   Reply to topic    Bot Depot Forum Index -> AIM Protocol & questions
View unanswered posts
Author Message
BradRobbo
Newbie
Newbie


Joined: 28 Nov 2003
Posts: 16

Reputation: 30Reputation: 30Reputation: 30

PostPosted: Fri Nov 28, 2003 8:07 pm    Post subject: Reply with quote

Hi, im new here! Very Happy woohoo 4 me


I have a perl bot for AIM, i managed to get it werking and stuff, and i have used the /addreply command to make it so *lazy* can add ther own replies for my bot, i know i can also edit this information in my data.txt (in my bots main folder Very Happy )
this is a bit of text i have!
Code:
<br />What you doin][Nothing much|Nothing really|Chatting :-D|Im doin nout really;


now im wundering if i put
Code:
<br />What you doin|what are you doing|what you doin?][Nothing much|Nothing really|Chatting :-D|Im doin nout really;<br />

it would still work? i dont think it does as i tried it, so does this mean that i have to type each user-input as a new "thing" ?
thanx.....

two more things now:-

1: do i have to have my bot in the "bin" folder? (i probably got that wrong newayz lol Razz) can i use a different folder (keeping the sub folders intact)

2Smile when i am putting in my q's and replies,....
my bot thinks there is a difference between "what?" and "what" , so do i need to make it filter punctuation??? if so wer would i put the filter

Cheers Very Happy
Back to top
Nate
God Like
God Like


Joined: 12 Nov 2003
Posts: 553

Reputation: 41.3Reputation: 41.3Reputation: 41.3Reputation: 41.3

PostPosted: Fri Nov 28, 2003 10:49 pm    Post subject: Reply with quote

Alright, first of all the pipes in the user's input side of your file should work. And another thing, 1. You don't have to put your bot in the bin folder, in fact I'd strongly not recommend it (makes it easier when you know which files are yours and which aren't), and 2. Here's how to filter puncuation (I know there's another better way but I'm not exactly sure how to do it)

Code:
$msg =~ s/\?//g;<br />$msg =~ s/\!//g;<br />$msg =~ s/\.//g;<br />$msg =~ s/\,//g;


You can just put that at the top of your thought.pl after it gets $msg from the shifts.

Anyway, the other way to do it is something like
Code:
$msg =~ s/["A-Z", "a-z", "0-9"]/


Or something. I don't know. Somebody will probably reply here how to do it. Razz
Back to top
BradRobbo
Newbie
Newbie


Joined: 28 Nov 2003
Posts: 16

Reputation: 30Reputation: 30Reputation: 30

PostPosted: Fri Nov 28, 2003 11:27 pm    Post subject: Reply with quote

i dont know which topic to post this bit in but, i just realised now, if i send ANYTHING that it doesnt understand, it quits,,,,, i dont think i have edited the thought.pl wer it sends the none understanding message ....
:-S
And cheers For that, im gonna try that now ill post results


Edit
I am like, 1 day new to all this, and i don't understand alot of the stuff, but i get the gist of perl i think.../hope
but could you tell me wat shift means? (eg my $victim = shift;) does it make it for only that sub file or sumthin? :blink:
Back to top
Keenie
Almost An Agent
Almost An Agent


Joined: 31 Oct 2003
Posts: 1071

Reputation: 52.4

PostPosted: Fri Nov 28, 2003 11:50 pm    Post subject: Reply with quote

it gets the variables passed from the last sub

lets say i want to call a sub name error which will check a string and see if it contains an string i classify as shouldnt be there.. you could call it like this

Code:
$error = error("our string");


then in the error sub it would be shaped like this

Code:
sub error {<br />my $string = shift; #this gets the string we passed from the last part<br />#do some stuff and test<br />return "our final string that will be held in $error from the last part of the example";<br />}
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> AIM Protocol & questions All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group