mIRC Home    About    Download    Register    News    Help

Print Thread
#99749 04/10/04 11:29 PM
Joined: Jun 2004
Posts: 3
D
demmy Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Jun 2004
Posts: 3
can someone help me get this working?
the problems that be are that i cannot get it to say "added by nick" and to respond to the "!..." commands.
help is appreaciated

remote:
on *:TEXT:url*:?: { write fun.txt $$2 3 || added by: $nick $+ 3 || on /msg $nick Thank you. Quote has been added }
}
on *:TEXT:!addquote*:#:/addquote $1-
on *:TEXT:!quote*:#:/quote $1-
on *:TEXT:!version*:#:/version $1-
on *:TEXT:!delquote*:#:/delquote $1-
on *:TEXT:!findquote*:#:/search $1-
on *:TEXT:!commands*:#:/commands $1-

menu channel {
Quotes ( $+ %quote $+ )
.on: { set%quote on | /msg # 3 quotes are on! (use !commands for helpA) }
.off: { set %quote off | /msg # 3 quotes are gone! 3 }
}

variables:
%t.q
%e.q 1
%found
%quote off

aliases:
/F1 {
//echo $chan commands
//echo $chan ----------------------------------
//echo $chan F2 = Random Quote
//echo $chan F3 = Commands
}
/F2 { /quote }
/F3 { /commands }
/F4 { /search . $?"What to look for?" }
}

/quote {
if (%quote == on) {
if ($2 == $null) {
/msg $chan QUOTE: (Quote 3 %t.q) $read(quote.txt)
}
else {
/msg $chan QUOTE: ( $+ $2 $+ / $+ %t.q $+ ) $read(quote.txt, $2)
}
}
}
}

/search {
if (%quote == on) {
set %found $read(quote.txt, w, * $+ $2- $+ *)
if (%found == $null) {
/msg $chan Sorry Nothing Found
}
else { /msg $chan Found: %found
}
set %found
}
}

/commands {
if (%quote == on) {
/msg $chan !addquote <quote>, !version, !findquote <key word>, !commands, !delquote <number>
}
}

/addquote {
if (%quote == on) {
/write quote.txt $2-
/msg $chan QUOTE: 9 $2- Added!
inc %t.q 1
inc %e.q 1
}
}

/version {
if (%quote == on) {
/msg $chan Demdem's quote bot:3 %t.q 
}
}

/delquote {
if (%quote == on) {
if ($2 >= %e.q) || ($2 == $null) {
/msg $chan Sorry Cannot Delete! Please use !delquote <number>
/halt
}
else {
/msg $chan QUOTE: $read(quote.txt, $2) it ish gone! yesh it ish!
/write -dl $+ $2 quote.txt
dec %t.q 1
dec %e.q 1
}
}
}

#99750 04/10/04 11:44 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
There is no $chan in the alias /addquote (neither in any of the aliases in your post). I suggest you to add the $chan to the alias. Eg:

on *:TEXT:!addquote*:#:/addquote $chan $1
/addquote {
if (%quote == on) {
/write quote.txt $2-
/msg $1 QUOTE: 9 $2- Added!
inc %t.q 1
inc %e.q 1
}
}


Doing that in the aliases should fix the issue.

Hope this helps smile
Zyzzyx.


"All we are saying is give peace a chance" -- John Lennon
#99751 07/10/04 11:42 AM
Joined: Jun 2004
Posts: 3
D
demmy Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Jun 2004
Posts: 3
thanks for the help, but i still cannot get it to work even with the script changes you gave me.

#99752 07/10/04 10:01 PM
Joined: Dec 2002
Posts: 145
G
Vogon poet
Offline
Vogon poet
G
Joined: Dec 2002
Posts: 145
on *:TEXT:!addquote*:#: {
if (%quote == on) {
/write quote.txt $2-
/msg $chan QUOTE: 9 $2- Added!
inc %t.q 1
inc %e.q 1
}
}

$chan and $1- would have a value

#99753 07/10/04 10:26 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
You have some extra closing braces (})
Code:
on *:TEXT:url*:?: {
  write fun.txt $$2 3 || added by: $nick $+ 3 || on [color:navy]$date
  msg $nick Thank you. Quote has been added
}[/color]
[color:red]}[/color]

/F2 { /quote }
/F3 { /commands }
/F4 { /search . $?"What to look for?" }
[color:red]}[/color]

/quote {
  if (%quote == on) {
    if ($2 == $null) {
      /msg $chan QUOTE: (Quote 3 %t.q) $read(quote.txt)
    }
    else {
      /msg $chan QUOTE: ( $+ $+($2,/,%t.q) $+ ) $read(quote.txt, $2)
    }
  }
}
[color:red]}[/color]


Remove the } braces.


Link Copied to Clipboard