This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

cry for help

Old posts that have not been replied to for several years.
Locked
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

cry for help

Post by metroid »

Code: Select all

set userflag 0

proc q:msg {text} {
    global userflag
    if {$userflag == "0"} {putquick "NOTICE $text :$text"} else {putquick "PRIVMSG $text :$text"}
}

proc msg:userflag {nick uhost hand text} {
	set a [getuser $hand XTRA userflag]
	putlog "1"
	if {$a == ""} {
	q:msg "PRIVMSG $nick :Your userflags are: (none)"
	putlog "2"
	} elseif {$a == "0"} {
	q:msg "NOTICE $nick :Your userflags are: +n"
	putlog "3"
	} elseif {$a == "1"} {
	putlog "4"
	q:msg "NOTICE $nick :Your userflags are: +m"
	}
I just can't get this work :(
D
DarkJFMan
Halfop
Posts: 85
Joined: Mon Dec 15, 2003 3:19 pm

Post by DarkJFMan »

Display errors if any. And what about the bind, don't you need to bind it to something?
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: cry for help

Post by user »

MeTroiD wrote:

Code: Select all

set userflag 0

proc q:msg {text} {
    global userflag
    if {$userflag == "0"} {putquick "NOTICE $text :$text"} else {putquick "PRIVMSG $text :$text"}
}

proc msg:userflag {nick uhost hand text} {
	set a [getuser $hand XTRA userflag]
	putlog "1"
	if {$a == ""} {
	q:msg "PRIVMSG $nick :Your userflags are: (none)"
	putlog "2"
	} elseif {$a == "0"} {
	q:msg "NOTICE $nick :Your userflags are: +n"
	putlog "3"
	} elseif {$a == "1"} {
	putlog "4"
	q:msg "NOTICE $nick :Your userflags are: +m"
	}
I just can't get this work :(
I think it works just fine..but maybe not as you intended :P
The argument you pass to q:msg is used both as a target and as a message (putquick "NOTICE $text :$text"), so the resulting string sent to the irc server will be something like this:

"NOTICE PRIVMSG someNick :Your userflags are: something :PRIVMSG someNick :Your userflags are: something"

which doesn't make much sense to me...poor "PRIVMSG"/"NOTICE" will get alot of one-word notices (because of the misplaced colon) :D
Have you ever read "The Manual"?
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Well thats my problem user, If i change q:msg it doesn't work anymore as it keeps giving me errors when i do, And as i put it to $text it doesnt work either as it has privmsg a user with a line :E
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

MeTroiD wrote:Well thats my problem user, If i change q:msg it doesn't work anymore as it keeps giving me errors when i do, And as i put it to $text it doesnt work either as it has privmsg a user with a line :E
What did you change and what error did you get?
Have you ever read "The Manual"?
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Well, i dont know how exactly, but it works now
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

The problem is with the variable you are trying to pass on to the new procedure as user has already defined.

Why are you trying to do it in two procedures? Do it in one simple as that (i.e. in msg:userflag). It might be a bit messy but, it would certainly work and be a bit faster. :wink:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

No awyeah, the point was to create a messenger that does a pm if that person wants to get pm'ed and gets noticed if he doesnt want pm's
Locked