|
Joined: Dec 2003
Posts: 199
Vogon poet
|
OP
Vogon poet
Joined: Dec 2003
Posts: 199 |
on *:TEXT:*#:{ if (%kaos.bot == yes) { search $strip($1-,c) } } alias search { var %x = 1 while (%x <= $lines(answers.txt)) { if ($1- isin $read(answers.txt,%x)) { notice $nick $talker(Too late, Someone else got that answer!) } if ($1- !isin $read(answers.txt,%x)) { search2 $strip($1-,c) } inc %x } } alias search2 { var %x = 1 while (%z <= $lines(%question)) { notice $nick $talker(Point Added!) | write answers.txt $1- inc %x } } --Variables-- %queston is: Eminem.txt %kaos.bot is: yes %left is: 12,1( %text is: 15,1 %right is: 12,1) Anyone see a problem with that?
Last edited by Kriminal; 23/02/04 09:34 AM.
Want to Link Servers? PM Me - EliteIRC.dyndns.org -
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
in the second one you have while %z <= ..., change z to x
New username: hixxy
|
|
|
|
Joined: Dec 2003
Posts: 199
Vogon poet
|
OP
Vogon poet
Joined: Dec 2003
Posts: 199 |
New(est) Code: on *:TEXT:*:#Kaos:{ if (%kaos.bot == yes) { search $strip($1-,c) } } alias search { var %x = 1 while (%x <= $lines(answers.txt)) { if ($1- isin $read(answers.txt,%x)) { notice $nick $talker(Too late, Someone else got that answer!) } if ($1- !isin $read(answers.txt,%x)) { search2 $strip($1-,c) } inc %x } } alias search2 { var %x = 1 while (%x <= $lines(%question)) { notice $nick $talker(Point Added!) | write answers.txt $1- inc %x } } -- --Still not working.
Last edited by Kriminal; 23/02/04 09:07 AM.
Want to Link Servers? PM Me - EliteIRC.dyndns.org -
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
I think its working fine, I just doubt its doing what you want it to do.
What is it that you expected to happen when someone typed something. Give maybe 3 or 4 examples with each producing differnt results.
|
|
|
|
Joined: Dec 2003
Posts: 199
Vogon poet
|
OP
Vogon poet
Joined: Dec 2003
Posts: 199 |
Say you said Bully in the channel It's supposed to say: Blah blah you got it blah blah and write it in answers.txt and say someone else tried to do it It would msg the person with "Already Used" or something like that and wouldn't write it in answers.txt ~Krim
Want to Link Servers? PM Me - EliteIRC.dyndns.org -
|
|
|
|
Joined: Dec 2003
Posts: 199
Vogon poet
|
OP
Vogon poet
Joined: Dec 2003
Posts: 199 |
on *:TEXT:*:#Kaos:{ if (%kaos.bot == yes) { search $strip($1-,c) } } alias search { var %x = 1 while (%x <= $lines(answers.txt)) { if ($1- isin $read(answers.txt,%x)) { notice $nick $talker(Too late, Someone else got that answer!) } if ($1- !isin $read(answers.txt,%x)) { search2 $strip($1-,c) } inc %x } } alias search2 { var %x = 1 while (%x <= $lines(Eminem.txt)) { if ($1- isin $read(Eminem.txt,%x)) { notice $nick $talker(Point Added!) | write answers.txt $1- } inc %x } } Updated; I replaced %question with Eminem.txt to see and I added a "if" statement in the search2 alias, still not working, Any clue why anyone? =/
Want to Link Servers? PM Me - EliteIRC.dyndns.org -
|
|
|
|
Joined: Mar 2003
Posts: 612
Fjord artisan
|
Fjord artisan
Joined: Mar 2003
Posts: 612 |
i dont think $nick returns anything in an alias just in a remote, try settin the nick as a variable and calling that.
billythekid
|
|
|
|
Joined: Jan 2003
Posts: 1,063
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 1,063 |
you are right, as soon as you leave the event, $nick has no value. from the aliasses you can't use identifiers as $chan or $nick best is to pass $nick as the first parameter... here is a sample:
{ search $nick $strip($1-,c) }
alias search { var %x = 1
while (%x <= $lines(answers.txt)) { if ($2- isin $read(answers.txt,%x)) { notice $1 $talker(Too late, Someone else got that answer!) }
if ($2- !isin $read(answers.txt,%x)) { search2 $1 $strip($2-,c) }
inc %x
}
}
If it ain't broken, don't fix it!
|
|
|
|
Joined: Dec 2003
Posts: 199
Vogon poet
|
OP
Vogon poet
Joined: Dec 2003
Posts: 199 |
Newest Update: on *:TEXT:*:#Kaos:{ if (%kaos.bot == yes) { search $nick $strip($1-,c) } } alias search { var %x = 1 while (%x <= $lines(answers.txt)) { if ($2- isin $read(answers.txt,%x)) { notice $1 $talker(Too late, Someone else got that answer!) } if ($2- !isin $read(answers.txt,%x)) { search2 $1 $strip($2-,c) } inc %x } } alias search2 { var %x = 1 while (%x <= $lines(Eminem.txt)) { if ($2- isin $read(Eminem.txt,%x)) { notice $1 $talker(Point Added!) | write answers.txt $2- } inc %x } }
-What Works: If the Answer is already in answers.txt (I put it in manually) The notice works. (Im sure the $nick wasn't the problem) - but it wont do search2 part. ~Krim
Last edited by Kriminal; 23/02/04 11:20 AM.
Want to Link Servers? PM Me - EliteIRC.dyndns.org -
|
|
|
|
Joined: Mar 2003
Posts: 612
Fjord artisan
|
Fjord artisan
Joined: Mar 2003
Posts: 612 |
alias search { var %x = 1
while (%x <= $lines(answers.txt)) {
if ($2- isin $read(answers.txt,%x)) { notice $1 $talker(Too late, Someone else got that answer!) }
[color:red]else[/color]if ( $2- !isin $read(answers.txt,%x)) { search2 $1 $strip($2-,c) }
inc %x
}
}
try that, i've had if / elseif problems before, i'd try it myself but im at work without mIRC atm ;o( edit: sorry didnt read the whole post, shoot me ;oP
Last edited by billythekid; 23/02/04 11:26 AM.
billythekid
|
|
|
|
Joined: Dec 2003
Posts: 199
Vogon poet
|
OP
Vogon poet
Joined: Dec 2003
Posts: 199 |
on *:TEXT:*:#Kaos:{ if (%kaos.bot == yes) { search $nick $strip($1-,c) } } alias search { var %x = 1 while (%x <= $lines(answers.txt)) { if ($2- isin $read(answers.txt,%x)) { notice $1 $talker(Too late, Someone else got that answer!) } elseif ($2- !isin $read(answers.txt,%x)) { search2 $1 $strip($2-,c) } inc %x } } alias search2 { var %x = 1 while (%x <= $lines(Eminem.txt)) { if ($2- isin $read(Eminem.txt,%x)) { notice $1 $talker(Point Added!) | write answers.txt $2- } inc %x } } Is what I tried --This is quite frustrating cause I'm like, nearly 100%, my code should've worked from my 2nd-3rd fix. =/ --No work =/
Want to Link Servers? PM Me - EliteIRC.dyndns.org -
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
You can try this on *:TEXT:*:#Kaos:if (%kaos.bot == yes) { search $strip($1-,c) }
alias search {
var %x = 1
while (%x <= $lines(answers.txt)) {
if ($1- isin $read(answers.txt,%x)) { notice $nick Too late, Someone else got that answer! | return }
inc %x
}
search2 $strip($1-,c)
}
alias search2 {
var %x = 1
while (%x <= $lines(Eminem.txt)) {
if ($1- isin $read(Eminem.txt,%x)) { notice $nick Point Added! | write answers.txt $1- }
inc %x
}
} Or this much shorter version on *:TEXT:*:#Kaos:{
if (%kaos.bot == yes) {
if $read(answers.txt,wn,$+(*,$1-,*)) { notice $nick Too late, Someone else got that answer! }
elseif $read(Eminem.txt,wn,$+(*,$1-,*)) { notice $nick Point Added! | write answers.txt $1- }
}
}
|
|
|
|
Joined: Dec 2003
Posts: 199
Vogon poet
|
OP
Vogon poet
Joined: Dec 2003
Posts: 199 |
Thanks a Bunch Iori, But, Can you tell me what it had to be right there for it to work "the Search2 part" had to be here: inc %x } search2 $strip($1-,c) } I like understanding codes that I make that don't work and are fixed by someone.
Want to Link Servers? PM Me - EliteIRC.dyndns.org -
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
Well with that first code, I just copied what you had and only 'fixed' the part that wasn't working, which was the loop). That particular command could simply have been "search2 $1-"
|
|
|
|
|