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.

premature end of expression?

Old posts that have not been replied to for several years.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Well I didn't had a problem with the duration till I've upgraded my eggdrop to 1.6.13, so I think there is not an problem with the list. Anyway I'll test if the list is well made as should be done.
Once the game is over, the king and the pawn go back in the same box.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I've used this code:

bind pub n .users list:users

proc list:users {nick host hand chan arg} {
global next
set temp(list) [next:cmds get_list $chan]
foreach element $temp(list) {
putlog "Element on list: $element"
}
}

and here is what I got:
[11:40] Element on list: moo
[11:40] Element on list: 1042623583
Once the game is over, the king and the pawn go back in the same box.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

OK - From your posting, it has become self evident what the issue is. It seems the list is being malformed. Those values should be on one line, rather than 2.

I have found the issue from this.

When the first person is added to the list, the script will select between using the "set" or "lappend" commands, based on if the list for that channel exists.

The problem is, it uses "set" if the list doesn't exist.

To fix this, we can hardcode it to use "lappend", which creates the list if need be.

Find and locate the "next:cmds" proc. The first switch method is add_list. Within this segment, locate the 2 line

Code: Select all

set temp(cmd) [expr {![info exists next(:list:$channel)]?"set":"lappend"}]
$temp(cmd) next(:list:$channel) [list $nick [clock seconds]]
Change them to the following

Code: Select all

lappend next(:list:$channel) [list $nick [clock seconds]]
AKA, delete the first line (can be done with CTRL+K while on the line in pico), and change the first part of the second command.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Seems that we have fixed the problem. Thanks. How to fix this thing: "You are number \0021\002 in line". The number 1 should be with bold and is not. Where is the problem?
Once the game is over, the king and the pawn go back in the same box.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Change the line in the next(welcome) setting from
You are number \002!number!\002 in line. NO colours
to
You are number\002 !number! \002in line. NO colours
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Nope. Same thing happens. "You are number \002 1 \002 in line."
Once the game is over, the king and the pawn go back in the same box.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Find the proc next:moretools:replace

At the end of it, you have "return $text"

Change this to
return [subst $text]
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

As I can see the next:moretools:replace proc is 'eating' them..
Once the game is over, the king and the pawn go back in the same box.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

When the welcome msg is like this: "You are number \002!number!\002 in line." It dosen't return the value of !number! Ex: You are number \002!number!\002 in line.

When the welcome msg is like this: "You are number \002 !number! \002 in line." It dosen't get number with bold and is the same till now. Ex: "You are number \0021 \002 in line."
Once the game is over, the king and the pawn go back in the same box.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

No - it is the way Tcl handles lists.

Lists are handled as is, without any normal subtitution.

IE.

Code: Select all

set list {hello $nick, \002how\002 are you [time]}
set string "hello $nick, \002how\002 are you [time]"
In the above, the $string varialbe will be correct, with both the $nick, the codes correctly translated and the command "time" replaced with whatever it returns.

Lists however, are considered lieraly. IE, $ nick is considered a word, and not a variable, and should be placed as is. The same applies to the codes.

The "subst" command can be used to get around this, and will make the substitution on demand, rather than the time the variable is set.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Oups.. You are right, as usualy.. :]
Once the game is over, the king and the pawn go back in the same box.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I have also noticed that the user is not removed from the list and fixed that. Seems that someone forgot to add them. :)

So, how to fix the bold thinghie then?
Once the game is over, the king and the pawn go back in the same box.
Locked