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.

Trivia rank

Old posts that have not been replied to for several years.
Locked
F
FuE-
Halfop
Posts: 57
Joined: Sat Nov 27, 2004 3:46 pm

Trivia rank

Post by FuE- »

hi i use http://www.eggdrop.za.net/ trivia script. if i wanna make so if i write !rank in mainchan i can see my rank to and f i write !rank <user> i can se others rank to.. how can i do that.. the text below is the script from the /msg <bot> rank..... please help me

Code: Select all

#triggered when someone /msgs the bot with the score lookup command.
proc tgscorelookup {nick host hand text} {
	global tgscoresbyname tgranksbyname tgscorestotal tgrealnames
	if {$text==""} { set text $nick } else { set text [lindex [split $text] 0] }
	tggetscores
	if {![info exists tgscoresbyname([strlwr $text])]} {
		if {[strlwr $text]==[strlwr $nick]} {
			set _who "[tgcolmisc1]You are"
		} else {
			set _who "[tgcolmisc2]$text [tgcolmisc1]is"
		}
		[tgpriv] $nick "[tgbold]$_who [tgcolmisc1]not on the score list."
	} else {
		if {[strlwr $text]==[strlwr $nick]} {
			set _who "[tgcolmisc1]You have"
		} else {
			set _who "[tgcolmisc2]$tgrealnames([strlwr $text]) [tgcolmisc1]has"
		}
		[tgpriv] $nick "[tgbold]$_who [tgcolmisc2]$tgscoresbyname([strlwr $text])[tgcolmisc1] points, ranked [tgcolmisc2][ordnumber $tgranksbyname([strlwr $text])] [tgcolmisc1]of [tgcolmisc2]$tgscorestotal[tgcolmisc1]."
	}
}
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

add a new bind command at the top of the script with the other binds.

Code: Select all

bind pub - !rank tgscorelookup
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
F
FuE-
Halfop
Posts: 57
Joined: Sat Nov 27, 2004 3:46 pm

Post by FuE- »

what ya mean (= help me :roll:
d
dossi
Voice
Posts: 30
Joined: Mon Dec 20, 2004 9:21 pm

Post by dossi »

Add that line to the beginning of the script.
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

FuE- wrote:what ya mean (= help me :roll:
Look in your trivia script. At the top of the script you should see a few lines with the word bind at the front.
Under the last bind copy this bit of code into the script.

Code: Select all

bind pub - !rank tgscorelookup
Save the script.
Restart your bot.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
F
FuE-
Halfop
Posts: 57
Joined: Sat Nov 27, 2004 3:46 pm

Post by FuE- »

i added

Code: Select all

bind pub -|- !rank proc_tgscorelookup
and when i do !rank i get

Code: Select all

tcl error [proc_tgsscorelookup]: invalid command name "proc_tgsscorelookup"
i changed it to

Code: Select all

bind pub -|- !rank tgscorelookup
and i get

Code: Select all

tcl error [tgsscorelookup]: wrong # args: should be "tgsscorelookup nick host hande text"
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

try changing:

Code: Select all

proc {nick host hand text} {
to

Code: Select all

proc {nick host hand chan text} {
F
FuE-
Halfop
Posts: 57
Joined: Sat Nov 27, 2004 3:46 pm

Post by FuE- »

wrong again.. this is my script now...

Code: Select all

### SET PROCS ###############
set procs {
	rank:proc_tgscorelookup
}
#############################
### SET BINDINGS ############
bind pub -|- !rank proc_tgscorelookup
#############################

proc proc_tgscorelookup {nick host hand text} {
   global tgscoresbyname tgranksbyname tgscorestotal tgrealnames
   if {$text==""} { set text $nick } else { set text [lindex [split $text] 0] }
   tggetscores
   if {![info exists tgscoresbyname([strlwr $text])]} {
      if {[strlwr $text]==[strlwr $nick]} {
         set _who "[tgcolmisc1]You are"
      } else {
         set _who "[tgcolmisc2]$text [tgcolmisc1]is"
      }
      [tgpriv] $nick "[tgbold]$_who [tgcolmisc1]not on the score list."
   } else {
      if {[strlwr $text]==[strlwr $nick]} {
         set _who "[tgcolmisc1]You have"
      } else {
         set _who "[tgcolmisc2]$tgrealnames([strlwr $text]) [tgcolmisc1]has"
      }
      [tgpriv] $nick "[tgbold]$_who [tgcolmisc2]$tgscoresbyname([strlwr $text])[tgcolmisc1] points, ranked [tgcolmisc2][ordnumber $tgranksbyname([strlwr $text])] [tgcolmisc1]of [tgcolmisc2]$tgscorestotal[tgcolmisc1]."
   }
} 
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

FuE- wrote:wrong again.. this is my script now...

Code: Select all

### SET PROCS ###############
set procs {
	rank:proc_tgscorelookup
}
#############################
### SET BINDINGS ############
bind pub -|- !rank proc_tgscorelookup
#############################

proc proc_tgscorelookup {nick host hand text} {
   global tgscoresbyname tgranksbyname tgscorestotal tgrealnames
   if {$text==""} { set text $nick } else { set text [lindex [split $text] 0] }
   tggetscores
   if {![info exists tgscoresbyname([strlwr $text])]} {
      if {[strlwr $text]==[strlwr $nick]} {
         set _who "[tgcolmisc1]You are"
      } else {
         set _who "[tgcolmisc2]$text [tgcolmisc1]is"
      }
      [tgpriv] $nick "[tgbold]$_who [tgcolmisc1]not on the score list."
   } else {
      if {[strlwr $text]==[strlwr $nick]} {
         set _who "[tgcolmisc1]You have"
      } else {
         set _who "[tgcolmisc2]$tgrealnames([strlwr $text]) [tgcolmisc1]has"
      }
      [tgpriv] $nick "[tgbold]$_who [tgcolmisc2]$tgscoresbyname([strlwr $text])[tgcolmisc1] points, ranked [tgcolmisc2][ordnumber $tgranksbyname([strlwr $text])] [tgcolmisc1]of [tgcolmisc2]$tgscorestotal[tgcolmisc1]."
   }
} 
You didn't try what I suggested. Also, there's no need for "set procs" and there's no need to make a new proc while it already exists in trivia.tcl
F
FuE-
Halfop
Posts: 57
Joined: Sat Nov 27, 2004 3:46 pm

Post by FuE- »

i fixed, tnx dudes :)
t
teduh
Voice
Posts: 2
Joined: Mon May 02, 2005 1:55 am

Trivia scripts

Post by teduh »

I use http://www.eggdrop.za.net/ trivia scripts and work fine, is it any other way to change if user wanna se their score just by typing just !score on the channel , rather than /msg <botnick> score

thanks
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

If you read what we've done in this thread, you would've noticed that he requested the same but it's !rank and not !score... If you want, just change !rank to !score.
t
teduh
Voice
Posts: 2
Joined: Mon May 02, 2005 1:55 am

Post by teduh »

Sir_Fs said:
If you read what we've done in this thread, you would've noticed that he requested the same but it's !rank and not !score... If you want, just change !rank to !score.


Wouldnt it display the top5 or top10 rank? if i am not wrong, all i need is just to display his or her own score/ point.


thanks
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

I'm not sure about that, but I think it'll only display your score/rank... try it.
Locked