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.

invalid idx

Old posts that have not been replied to for several years.
Locked
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

invalid idx

Post by Ofloo »

why do i get an invalid idx ?? in the second proc

Code: Select all

bind dcc m netip send:netip 
bind bot - netip bot:netip 

proc send:netip {handle idx arg} { 
global botnick 
  set MyIP "" 
  foreach a {a b c d e f g h i j k} { 
      catch { 
     set external [socket $a.root-servers.net 53] 
     set MyIP [lindex [fconfigure $external -sockname] 0] 
     close $external              
    } 
  if { ![string equal $MyIP ""] } { break } 
  } 
  putdcc $idx "Botnick: $botnick BotIP: $MyIP"
  putallbots "netip"
} 

proc bot:netip {handle idx arg} {
  set MyIP "" 
  foreach a {a b c d e f g h i j k} { 
      catch { 
     set external [socket $a.root-servers.net 53] 
     set MyIP [lindex [fconfigure $external -sockname] 0] 
     close $external              
    } 
  if { ![string equal $MyIP ""] } { break } 
  } 
  putdcc $idx "BotIP: $MyIP"
}
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Read about the 'bot' bind -- the 2nd parameter isn't an idx!
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

what you mean the second parameter isn't an idx ?? where can i read about this i mean what am i looking for ?

it works when add global botnick and if i do this

Code: Select all

putdcc $idx "Botnick: $botnick BotIP: $MyIP"
instead of this

Code: Select all

putdcc $idx "BotIP: $MyIP"
but in party line when a bot answers it shows the nick so i don't need an second nick
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

ah i see

BOT

bind bot <flags> <command> <proc>
proc-name <from-bot> <command> <text>

Description: triggered by a message coming from another bot in the botnet. The first word is the command and the rest becomes the text argument; flags are ignored.

Module: core

got an example ?

what do i use to send it to the botnet so i can read it from an other bot cause ive read about putbot and it only intcepts it for scripting else ignored so ... ??
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Example:

Code: Select all

bind dcc o botnet botnet:dcc
bind bot - botnet botnet:bot

proc botnet:dcc {hand idx arg} {
  switch -exact -- [strlwr [lindex $arg 0]] {
    "bla" {
      putallbots "botnet $hand bla"
    }
  }
}

proc botnet:bot {hand idx arg} {
  set arg  [lrange $arg 1 end]
  set hand [lindex $arg 0]@$hand
  switch -exact -- [strlwr [lindex $arg 0]] {
    "bla" {
      putlog "$hand told be bla"
    }
  }
}
something like this anyway :)
Once the game is over, the king and the pawn go back in the same box.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

hmm nice but not exacly what i wanted to know i think cause putlog won't show it on the party line and i want the bots to show there ips over the party line .. :/ or am i wrong ?? cause me kinda little noob at this hehe

i think i might have a solution but it seems to difficult i think there is a beter way

if i use putbot it is an event that is ignored by party line bots only for script perphoses, so if i catch the file event and send args with it and show them that would work as wel but isn't there an easyer way ?? cause i don't know mutch commands and i don't see any in the eggdrop docu.

plz syntax + simple example
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I don't understand exactly what you want to do there, anyway, in order to get the ip from a bot first send a msg to the target to tell his ip then the target should send back the answer answer, something like this anyway.
Once the game is over, the king and the pawn go back in the same box.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

yes something like that

i type .netip
and get the list of all the ips on the bots.

so send command .netip
then get back

bot 1 ip
bot 2 ip
bot 3 ip
bot 4 ip
bot 5 ip

this over the party line ..
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Put this in a tcl file and load it on the master (hub):

Code: Select all

# master
bind dcc o netip netip:dcc 
bind bot - result result:bot

proc netip:dcc {hand idx arg} { 
  putallbots "netip $idx yourip"
}

proc result:bot {hand idx arg} { 
  putidx [lindex $arg 0] "\002$hand\002 answered back: [lrange $arg 1 end]"
}
and this in your slaves (leafs):

Code: Select all

# slave
bind bot - netip netip:bot 

proc netip:bot {hand idx arg} { 
  switch -exact -- [strlwr [lindex $arg 1]] { 
    "yourip" { 
      putbot $hand "result [lindex $arg 0] ${::my-ip}"
    } 
  } 
}
I've made it reply the results only to the person who dose the .netip thing.
Once the game is over, the king and the pawn go back in the same box.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

didn't work at first but changed the var myip now it works great tnx man

not required but can i ask you little favor can you give some explaination of what you did so i understand better not required tho if you want to ...

Code: Select all

# master 
bind dcc o netip netip:dcc 
bind bot - result result:bot 

proc netip:dcc {hand idx arg} { 
  putallbots "netip $idx yourip" 
} 

proc result:bot {hand idx arg} { 
  putidx [lindex $arg 0] "\002$hand\002 answered back: [lrange $arg 1 end]" 
} 

# slave 
bind bot - netip netip:bot 

proc netip:bot {hand idx arg} { 
set MyIP "" 
foreach a {a b c d e f g h i j k} { 
    catch { 
   set external [socket $a.root-servers.net 53] 
   set MyIP [lindex [fconfigure $external -sockname] 0] 
   close $external             
  } 
if { ![string equal $MyIP ""] } { break } 
}
  switch -exact -- [strlwr [lindex $arg 1]] { 
    "yourip" { 
      putbot $hand "result [lindex $arg 0] $MyIP" 
    } 
  } 
} 
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

The master part load on the master, the eggdrop yo want to perform commands from and the slave on the rest of the bots you want to get an answer from. Something like this anyway. :)
Once the game is over, the king and the pawn go back in the same box.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

yes i know and it works great hehe i just wanted to know what you coded but like more how to look at it so i can do this my self next time hehe
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Well, the master sends a ms to the slave who answers back to the master's question. Simple huh? :lol:
Once the game is over, the king and the pawn go back in the same box.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

indeed tnx man
Locked