Minor bug with router problem

Releases and bugs in here...
deftonzs
Posts: 18
Joined: 2003-01-05 16:56

Minor bug with router problem

Post by deftonzs » 2003-02-03 20:30

I have a router, and as the operator of the server i am set to *active*, but since i'm on a router it will report my ip as 192.168.1.1, and then i keep getting kicked from the server for not haveing my ip setup correctly, anyway to get around this?

is there an option to turn this on and off for ops? or something like that?

deftonzs
Posts: 18
Joined: 2003-01-05 16:56

lua scripts

Post by deftonzs » 2003-02-03 21:50

oh, and is there anyway to get the messages from the trig bots and such to show up after the person says the thing? it's kinda weird when it looks like this lol...

[16:48] <Trig> Oh no, PtokaX =(
[16:48] <test> ptokax

you would think it would come after the comment... oh well ;)

if you could get that fixed it would be great...


btw i will be beta testing at deftonzs.com:411 with no lua scripts...

and deftonzs.com:1411 with lua scripts...

deftonzs.com:411 has about 100 users, and :1411 just has me :)

deftonzs

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 14:32

Re: lua scripts

Post by Sedulus » 2003-02-03 22:13

deftonzs wrote:[16:48] <Trig> Oh no, PtokaX =(
[16:48] <test> ptokax

you would think it would come after the comment... oh well ;)

if you could get that fixed it would be great...


LuaScript.txt wrote:Consider the ClientMessage event that's
fired when somebody writes a message; if you want to write a bot that
says "hello" every time someone says "hi", the bot answer will be sent
before the hub sends out the message to the other clients, and therefore,
the order of the hello and hi will come out strange...keep it in mind...
(and use ACTION_HANDLED wisely to avoid bad situations)


I haven't played with this yet.. but I think you should do:

Code: Select all

hubMessage(incoming_msg, client:getNick())
hubMessage(trigged_msg, bot_name)
return ACTION_HANDLED
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

deftonzs
Posts: 18
Joined: 2003-01-05 16:56

Post by deftonzs » 2003-02-03 22:35

i tried what you just said and now all it does is reply to what i said... and not actually say what i say... :-/

[17:31] <Trig> See ya test
[17:31] <@DCH++> Scripts reloaded
[17:31] <@Trig> See ya test
[17:31] <@Trig> See ya test
[17:31] <@DCH++> Scripts reloaded
[17:31] <test> bye
[17:31] <test> fuck
[17:32] <@DCH++> Scripts reloaded
[17:32] <test> bye
[17:32] <test> bye
[17:32] <@DCH++> Scripts reloaded
[17:32] <@Trig> See ya test
[17:32] <@DCH++> Scripts reloaded
[17:32] <@Trig> See ya test
[17:32] <test> bye

see??

so i tried moving some stuff around but still, no apples :(

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 14:32

Re: Minor bug with router problem

Post by Sedulus » 2003-02-04 14:30

deftonzs wrote:I have a router, and as the operator of the server i am set to *active*, but since i'm on a router it will report my ip as 192.168.1.1, and then i keep getting kicked from the server for not haveing my ip setup correctly, anyway to get around this?

Code: Select all

function clientLine(client, msg)
    if client:getNick() == "[Rug.nl]Sedulus" then
        local ret,c,othernick
        ret,c,othernick = string.find( msg, "^$ConnectToMe ([^ ]+) " )
        if ret then
--          othernick.client:send( msg )    -- does not work!
            sendToAll( msg )    -- should only be sent to <othernick> (but I don't know the function)
            return ACTION_HANDLED
        end
        ret,c = string.find( msg, "^$Search " )
        if ret then
            sendToAll( msg )
            return ACTION_HANDLED
        end
    end
end
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

arnetheduck
The Creator Himself
Posts: 296
Joined: 2003-01-02 22:15

Post by arnetheduck » 2003-02-04 17:23

sed, perhaps I should appoint you as the official scripter =)

deftonzs
Posts: 18
Joined: 2003-01-05 16:56

Post by deftonzs » 2003-02-04 22:19

yes that sounds like a good idea, how about you make a mass message script, the one from ptokax doesn't work on here :)

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 14:32

Post by Sedulus » 2003-02-05 02:05

deftonzs wrote:i tried what you just said and now all it does is reply to what i said... and not actually say what i say... :-/
what the hell did you do?? it works...

Code: Select all

--- /var/uploads/TrickerBot.lua 2003-01-30 20:31:06.000000000 +0100
+++ TrickerBot.lua      2003-02-05 02:46:28.000000000 +0100
@@ -26,8 +26,9 @@
        for key, value in trigs do
                if( string.find( string.lower(msg), key) ) then
                        answer, x = string.gsub(value, "%b[]", client:getNick())
+                       hubMessage(msg, client:getNick())
                        hubMessage(answer, botname)
-                       break
+                       return ACTION_HANDLED
                end
        end
 end

about the hub-mass-message. that's a private message to all users. it needs all usernames. that is currently a waste of resources, since afaik there is no way to enumerate all users. so you'd have to store them all at login (see the PtokaX compatibility scripts).

just use hubMessage() for now..

(I appreciate that arne =) )
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

deftonzs
Posts: 18
Joined: 2003-01-05 16:56

Post by deftonzs » 2003-02-05 21:15

you have a different TrickerBot script then me then........

mine looks like this....

Code: Select all

function clientMessage(client, msg)
   -- look in the table
   for key, value in trigs do
      if( string.find( string.lower(msg), key) ) then
         answer, x = string.gsub(value, "%b[]", client:getNick())      -- Note; it's only called once...
         hubMessage(answer, botname)
         break
      end
         end

end


you have an extra

Code: Select all

+                       hubMessage(msg, client:getNick())

in there, i will cut and paste what you have and see if it works :-/

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 14:32

Post by Sedulus » 2003-02-05 21:29

http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

yakko
Posts: 258
Joined: 2003-01-27 06:04

Re: Minor bug with router problem

Post by yakko » 2003-02-08 17:56

Sedulus wrote:

Code: Select all

function clientLine(client, msg)
    if client:getNick() == "[Rug.nl]Sedulus" then
        local ret,c,othernick
        ret,c,othernick = string.find( msg, "^$ConnectToMe ([^ ]+) " )
        if ret then
--          othernick.client:send( msg )    -- does not work!
            sendToAll( msg )    -- should only be sent to <othernick> (but I don't know the function)
            return ACTION_HANDLED
        end
        ret,c = string.find( msg, "^$Search " )
        if ret then
            sendToAll( msg )
            return ACTION_HANDLED
        end
    end
end


How exactly do we use this?

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 14:32

Post by Sedulus » 2003-02-08 18:03

I fixed one thing...
now get it here:
http://wza.digitalbrains.com/DC/dchpp/NATusers.lua

* change my name(s) to yours
* add this to your LuaScript.xml and enter +reload

Code: Select all

        <Context><!-- note the /, use \ for windows -->
                <Script>scripts/NATusers.lua</Script>
        </Context>
* questions? go to the dc++ dev lounge
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

yakko
Posts: 258
Joined: 2003-01-27 06:04

Post by yakko » 2003-02-08 19:15

works great! Thanks!

Who is online

Users browsing this forum: Google [Bot] and 0 guests