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.

$char problem

Old posts that have not been replied to for several years.
Locked
s
spyda
Halfop
Posts: 64
Joined: Mon Aug 12, 2002 2:22 am
Location: Australia

$char problem

Post by spyda »

[12:52pm] <Asustek> [asus] Administrator Op (Kissmine)
[12:52pm] -Asustek- You have been Oped in #helpline
[12:52pm] <Kissmine> `op Moust\gone
[12:52pm] -Asustek- Moustgone is not in #helpline
I have been writing this script for about a week.. I have found my first problem.

Code: Select all

set asus_who [lindex $vasus 0]
if {[onchan $asus_who $chan] == "0"} {
  puthelp "NOTICE $nick :$asus_who is not in \002$chan\002"
  return 0
  }
  puthelp "PRIVMSG $asus(home) :$asus(logo) Oped \037(\037\002$nick!$uhost\002\037)\037 $chan \037\[\037\002Oped $asus_who\037\002]\037"
  puthelp "NOTICE $nick :Given ops to \002$asus_who\002 in \002$chan\002"
  puthelp "NOTICE $asus_who :You have been Oped in \002$chan\002 by \002$nick\002"
  pushmode $chan +o $asus_who
  return 0
 }
}

Now I looked into using strings (but I am still learning them) I came up with something like this.. But it dont work!

Code: Select all

set asus_who [lindex $vasus 0]
if {[string match [lrange $asus_who 1 end] "\"]} {[string replace "\" "$char(141)}
if {[onchan $asus_who $chan] == "0"} {
  puthelp "NOTICE $nick :$asus_who is not in \002$chan\002"
  return 0
  }
  puthelp "PRIVMSG $asus(home) :$asus(logo) Oped \037(\037\002$nick!$uhost\002\037)\037 $chan \037\[\037\002Oped $asus_who\037\002]\037"
  puthelp "NOTICE $nick :Given ops to \002$asus_who\002 in \002$chan\002"
  puthelp "NOTICE $asus_who :You have been Oped in \002$chan\002 by \002$nick\002"
  pushmode $chan +o $asus_who
  return 0
 }
}

Thanx in advance
User avatar
slennox
Owner
Posts: 593
Joined: Sat Sep 22, 2001 8:00 pm
Contact:

Post by slennox »

Somewhere in the script, you're not handling strings/lists correctly, and this will cause problems with 'special' characters like the backslash. The problem is occuring at or before this point:

Code: Select all

set asus_who [lindex $vasus 0]
So we'd need to see the parts of the script that lead up to this.

You also might find the following site useful:
http://www.soft.net.uk/staffs/eggdrop/characters.html
s
spyda
Halfop
Posts: 64
Joined: Mon Aug 12, 2002 2:22 am
Location: Australia

Post by spyda »

well Slennox,
Thanx for the replay.. I had a read over that url
You also might find the following site useful:
http://www.soft.net.uk/staffs/eggdrop/characters.html
It has helped out alot.. I am still learning strings, so that was half my problem!

I have made it work now.. But I did it the hard way (alot of coding and hours) I am looking at redoing it all with strings and making the 4 page script smaller. Thanx

Site rox
----------
ThePope
Locked