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.

General Beginner Tcl Help

Old posts that have not been replied to for several years.
Z
Zeusbwr

General Beginner Tcl Help

Post by Zeusbwr »

Ok.. i have multiple questions here heh.

1st:
(This Related to mIRC)
Is it posible to have a Multi server Tcl Eggdrop? And by this i mean have the Eggdrop be connected to Multiple Servers at a Time. Like with mIRC 6.0+ You can connect to multiple servers via /server -m irc.blah.com. What i am trying to do is convert my mIRC Bot, a Multiserver Relay Gamebot into Tcl to be hosted on Shells. So would it be possible for a tcl script to be connected to multiple servers and relay text from one channel to a dif channel on a dif server.

2nd:
Is it possible for a Eggdrop to have text be triggered and send text through DCC Chat?

3rd:
is there a place to get a helpfile or a helpsite somewhat like mIRCs help file? Where i can search through dif commands and descriptions of all the commands?

I dont mean to advertise, but if this dont make sense visit irc.nitrousnet.net #AncientArena for a Example of the Multi server bot, its mIRC but i wanna convert it to tcl, its still in early stages but if you dont understand it, it will make more sense once you see it. Thanks

4th: (Sorry had one more heh)
TCL Can do EVERYTHING mIRC Can correct? Im Mainly doing this so i can have my Gamebot Hosted on a Shell and be up All the time.

Thanks for the Help :)
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

4th: Tcl can do everything mIRC script can do, and far more.

Tcl is a standalone language, and is not bundled as part of eggdrop. Where mIRC has it's language built in, eggdrop uses Tcl, just for it's scripting capabilities.

3rd: Eggdrop comes awith a lot of helpfile, though not in windows help format.

When the software primary environment is *nix, then there aint no sence bindling a helpfile, designed for another operating system.

2nd: Yes. In eggdrop, you can bind to most events. see tcl-commands.doc for the types of events you can bind too.

1ST: No, nor will eggdrop ever become multi-server.

When you are hosting a bot on your won machine, it may seem simple enough, and non-consuming, but when you are a shell [provider, with possibily 500 eggdrops running, then that a lot of load.

By adding multi-server abilities, would more than double the load of the bot, thus the serve they run on.

Energymech is a bot that runs on multiple servers, though, there are very few shell provider that will allow you too run them, most that do, do not allow them intentionaly, more like a loophole, where they didn't specicicly ban them.

This ability is not likely to be added, as the coder wouldn't need such an ability. I mIRC, it's a closed source environment, thus, the creator had to bow to presure. With eggdrop, the source is open, should some1 want it, they can code it themselves, leaving the real coders to get on with the better stuff.
Z
Zeusbwr

Post by Zeusbwr »

is there ANY way that it is possible? I'll work the shell junk out, but just is it possible to do that with a TCL Script? if it aint that means mirc can do something tcl cant lol
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Very true, but this is only 1 thing. mIRC became lame with multi-server support. The scripting language should have been re-written before multi-server.

It is possible to link two eggdrops together, and send the messages between each other, to be realyed to other channels.

It is not possible to use one eggdrop on multiple servers.

Yes, you can create a Tcl to connect to multiple IRC servers, but it will be slow, eggdrop itself will slow down a lot and it will not benefit from eggdrops internal system, as it will need to be based on pure Tcl.
m
madgabz
Voice
Posts: 20
Joined: Thu Apr 04, 2002 8:00 pm
Location: Copenhagen, Denmark
Contact:

erm...

Post by madgabz »

Why do you want to run multiple sevrers?

If its only to link the same chennel on two different networks, then go use the excellent script: linkchan

Its very cool, and rather easy to setup!

ppslim tried to make a reconnect script linkchan if the bot or networks experienced any net-splits, but it never really worked. I have supplied it here:

Code: Select all

# TCL Script for Eggdrops to re-established channel-linking between different IRC networks
# Copyright ppslim@www.egghelp.org/forum <= U da MAN!

proc chk:restart {} {
  global uptime
  if {[expr $uptime + 60] > [unixtime]} {
    dcc:linkchan 0 0 {#YourChannel YourNetworkName YourNetworkServer IP YourNetworkPort}
  }
}
chk:restart
proc need:netsplit {args} {
  chk:restart
}
bind EVNT - "init-server" need:netsplit
Remember to edit the line: dcc:linkchan 0 0 {#YourChannel YourNetworkName YourNetworkServer IP YourNetworkPort}
..for the script to work for u!
Good Luck, m8
Z
Zeusbwr

Post by Zeusbwr »

Well see i run a MultiServer Gamebot, It relays text from one server to another and sometimes is on 5 servers sometimes just 2 heh, i have the server owners pay to have t on their server. The game itself is run through DCC Chat and is a MuD. Anyway, i think this might be more trouble than its worth :/. Thanks for your help
Z
Zeusbwr

Post by Zeusbwr »

this may sound stupid lol, but is there anytype of Linux mIRC? im mainly looking for a way to have the game hosted on a VERY Reliable host. thats why i was going to convert it to eggdrop and tcl. I Wanted it to be put on a shell heh. Anyone got any Ideas?
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

There are windows shells available. Mostly they run NT, maybe now 2000. I'm not sure they allow you to run gui programs, but who knows.

You can run mirc on linux inside wine (windows emulator), but again, linux shell hosts are probably not going to provide you with a gui.

Unless it's a long script or uses specific features of mirc script (dialogs? udp sockets?), it shouldn't be too hard to convert it to tcl. Most things are straightforward. All the ON:* crap becomes 'bind blah". Things like msg are putmsg or putserv.

Also, in response to ppslim, a Tcl to connect to multiple servers would not really be slow. The amount of time spent processing irc messages is tiny. It amounts to something like this:

Code: Select all

proc parse_irc {serv text} {
global current_server
set current_server $serv

set parts [split $text]
set source [lindex $parts 0]
if {[string index $source 0] != ":"} {
  set source ""
  set cmd $source
  set args [lrange $parts 1 end]
} else {
  set source [string range $source 1 end]
  set cmd [lindex $parts 1]
  set args [lrange $parts 2 end]
}
switch -exact -- $cmd {
  "privmsg" { ... }
  "join" { ... }
  "part" { ... }
  "quit" { ... }
  "ping" { ... }
}
It's probably faster than eggdrop, since eggdrop uses Tcl for the bind tables anyway. It has to convert back and forth between Tcl vars and C vars, whereas this would stay in Tcl and not even use bind tables. Also, it only listens for events that it's interested in and necessary events like ping, so a lot of processing work is removed.

It's true that this will not use Eggdrop's internal system, but that may be fine in this case because the script isn't written for eggdrop to begin with. It probably doesn't need things like output flow control.
Z
Zeusbwr

Post by Zeusbwr »

so when you say the windows emulator, but they wont allow GUI, (and im sure this sounds stupid lol) but would it matter about the GUI if i wasent used? cuz im not ganna be trying to use the GUI heh, Or maybe something to... supress the GUI.. rofl... im just tryin to think of options here lol
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

There is no unix version/ port of mIRC. Nor a client that uses mIRC script (most people consider the language lame).
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Zeusbwr wrote:so when you say the windows emulator, but they wont allow GUI, (and im sure this sounds stupid lol) but would it matter about the GUI if i wasent used? cuz im not ganna be trying to use the GUI heh, Or maybe something to... supress the GUI.. rofl... im just tryin to think of options here lol
Even though you won't be using the gui, mirc does not provide a way to disable its windows as far as I know. You could check and see if there is a wine option that suppresses the gui... that's actually highly possible. It would be something like

wine --nowindows mirc.exe (that's just a made up example of what it might be like)

Another option would be to run a really lightweight X server (the windows system unix uses) and have wine use that. An X server doesn't need to correspond to an actual monitor.

All in all I think it's definitely possible but it may take a bit of research. I noticed you said people pay you for this product, so maybe it's worthwhile to do. If you don't feel like doing it, you could always pay me :)
Z
Zeusbwr

Post by Zeusbwr »

lol how much would you charge lol, cuz i dont know enough about this [censored] lol

Id still have to check with the host imma use, unless you could find one too, so far they are willing to let me use the multi server feature and i pay per server as a BG, i emailed them about the wine thing but i havwnt gotten a response. Although this is just one shell, my friend said it was a good one so i decided to check em out. I Dont really care what shell i use as long as its fast and reliable lol
Z
Zeusbwr

Post by Zeusbwr »

oh and pp, it may be lame but its doing more for me than tcl can so far, id be happy to learn tcl scripting language to convert the bot to tcl, im just getting the facts to see if the bot could do all it does now and all i plan it to do.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

I was a bit harsh when I said lame.

These are not views.

Many people believe mIRC script is crap. Mainly due tot eh fact, it's not a real language, and there are parts of the code, that contradict itself.

It may do exactly what you want. The fact reamins, you should expect a language to define a few rules on the layout, then they are followed right the way through.

mIRC script is slow too, but thats somthing else.
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

If you're going to pay a full bg process per server anyway, then I think the best option (if you want to use eggdrop) is to run an eggdrop per server and link them in a botnet. If you can get the processes on different computers / providers, then when one computer goes down (DoS, maintenance, power failure, whatever), it only affects some of your bots instead of your whole operation. It will also make it easier to do your script since you'll be using normal eggdrop features instead of hacking up a multiserver bot or using some weird wine configuration (wine isn't 100% stable as it is heh).

If you want to use wine, the easiest thing is to download VNC for linux. It has a lightweight X server. Here's what I did:

start vnc's x server as display 1, vncserver :1
set the DISPLAY env var to use display 1, export DISPLAY=:1
start mirc, wine mirc.exe

It definitely has some quirks heh. The font is Arial or something but it's displaying as Script (the cursive one). This is cool because you can actually connect to it from home with VNC Viewer and treat it just like normal mirc.
Locked