Lua access...
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Lua access...

Started by Flow84, 08 July, 2004, 15:51:57

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Flow84

Hi.

Have some questions related to Lua scripts in DCDM++0.029.. (and other clients)

Is it possible to get the following fields to the lua script?? If. How?


      Description
      IP
      Tag
      Connection Type
      Status
      ISP
      SPEED
      Cheating Description


Is it Possible to call the command "/startchecking 1200000" or "/away" from a lua script??

and last.. but not less importent...
is it possible to change my own:

      Connection Type
      Description
      Status
      Tag (Version it says dc++ 0.401 all the time; Slots to 2 or 4)


plop

QuoteOriginally posted by Flow84
Hi.

Have some questions related to Lua scripts in DCDM++0.029.. (and other clients)

Is it possible to get the following fields to the lua script?? If. How?


      Description
      IP
      Tag
      Connection Type
      Status
      ISP
      SPEED
      Cheating Description
the myinfostring is availeble, from that info you can grab the tag/connection type/status.
the rest isn't posible i think, not sure here and it might change in the future.

QuoteOriginally posted by Flow84 Is it Possible to call the command "/startchecking 1200000" or "/away" from a lua script??
no you can't trigger those commands but /away can be made in in scripted form 2.
beside this you can make your own /commands.

QuoteOriginally posted by Flow84 and last.. but not less importent...
is it possible to change my own:

      Connection Type
      Description
      Status
      Tag (Version it says dc++ 0.401 all the time; Slots to 2 or 4)
again a no.
and personaly i can't really see the need for this.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Flow84

Hi. thanks for your fast answer. :)

Quotethe myinfostring is availeble, from that info you can grab the tag/connection type/status.

how do i do that?

Quoteand personaly i can't really see the need for this.

if you want to run it like a bot its useful..

Connection Type = "BOT"
Description = "type of bot"
Status = dont know all values.. maybe not so useful..
Version in Tag = "Dont want to show this.. possible security risk"
Slots in Tag = "more neat if it could show 0"

plop

QuoteOriginally posted by Flow84
Hi. thanks for your fast answer. :)

Quotethe myinfostring is availeble, from that info you can grab the tag/connection type/status.

how do i do that?
here's a old script i made 2 try sutch kind of thing, it kicks clients older then 0.304.
--// vim:ts=4:sw=4:noet
--//
--// the second argument decides in which order the scripts are run
--// use numbers when you need order, else you can just use a _unique_ identifier

VersionTable = {}

dcpp:setListener( "info", "minver",
	function( hub, user, msg )
		DC():PrintDebug(user:getNick().." from minversion script")
      --if user:isOp() == nil then
      local tmp = hub:getOpList()
      if tmp[user:getNick()] == nil then
         if VersionTable[user:getNick()] then
            VersionTable[user:getNick()] = VersionTable[user:getNick()] +1
                  DC():PrintDebug("username: "..user:getNick().."  number stored: "..VersionTable[user:getNick()])
            if VersionTable[user:getNick()] >= 2 then
               local s,e,tag=string.find(msg, "(%b<>)%$")
               DC():PrintDebug("tag: "..tag)
               local s,e,version=string.find(tag, "<%+%+%sV:([%d%.]+)")
               DC():PrintDebug("version: "..version)
               if tonumber(version) < 0.304 then
                  hub:sendChat("!kickuser "..user:getNick().." update your client")
               end
            end
         else 
            VersionTable[user:getNick()]=1
            DC():PrintDebug(user:getNick().."   "..VersionTable[user:getNick()])
         end
      else
               DC():PrintDebug(user:getNick().." is a op")
      end
	end																			
)

dcpp:setListener( "info", "onquit",
	function( hub, user, msg )
		DC():PrintDebug(user:getNick().." from minversion script, on quit part")
      if VersionTable[user:getNick()] then
         if VersionTable[user:getNick()] >= 2 then
            VersionTable[user:getNick()] = nil
            DC():PrintDebug(user:getNick().." removed from the table cause he left")
         else 
            DC():PrintDebug(user:getNick().." funny stuff")
         end
      end
   end
)

QuoteOriginally posted by Flow84 if you want to run it like a bot its useful..

Connection Type = "BOT"
Description = "type of bot"
Status = dont know all values.. maybe not so useful..
Version in Tag = "Dont want to show this.. possible security risk"
Slots in Tag = "more neat if it could show 0"
a good hub kicks you for those connection types or weird versions.
don't share anything with BCDC/DCDM solves the 0 slots, no share nothing 2 download.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

SMF spam blocked by CleanTalk