Newb Needs Script
 

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

Newb Needs Script

Started by Quicksilver, 24 September, 2004, 19:29:55

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Quicksilver

Hello evryone i hope someone can help me.

I need a script for my DCDM++ client that automatically lets the client jon on connect to a chatroom (Yoshihub-Chatroom).
That for it has to send  +join per Pm.
So problem is normal pm (done with raw command) doesn't work  it needs to be send the normal way to function.  (/pm +join).
My problem is that I can't find a script that sends something like this on connect neither do I know which commands to use for this /pm .. thingy nor seems this on connecting mixed with timers or how ever that is done to me so easy.
Well to set the crown to this is that this should be my first lua script that I ever needed (wanted to write) and I am stuck can't find any Api, besides my last piece of programming lies long ago.
So please can anyone show me how to write this script.
I am shure someone who knows lua can write sth like this in less than 5 Minutes, so plz Help.

BottledHate

i made something for you real quick.. sorry i didn't see your post ealier.....

dcdm(0.35-0.38): get this FILE  , rename it to startup.lua and replace yours. (+timer, +raw, +ownchatout)

BCDC4032: get this FILE  , rename it to startup.lua and replace yours. (+raw)

and here is the script:

--//send a pm to 'ChatBotName' containing 'CommandToSend' shorty after join('SecondsToWait').
--//dcdm startup.lua mod required!!! dl the one i made and replace the one u have. (0.35 - 0.38)

ChatBotName = "?ottledHat?" --//the name to send the pm to on connect.
CommandToSend = "+join" --//the command to send to the name above on join.
SecondsToWait = 3 --//number of seconds to wait before sending command.(if sent too early, command will not go through, 3 seconds as lowest setting.)

-------------------------
dcpp:setListener( "Raw", "joinchat", 
   function(h,m)
      if string.sub(m,1,6) == "$Hello" then
         if not sendTable then sendTable = {} end
         sendTable[h] = os.clock() + SecondsToWait
      end
   end
)
sentTo={}
dcpp:setListener( "timer", "joinchat", 
   function()
      if sendTable == nil then return end
      for k,v in sendTable do
         if os.clock() > v then
            if not sentTo[k] then
               DC():SendHubMessage(k:getId(), "$To: "..ChatBotName.." From: "..k:getOwnNick().." $<"..k:getOwnNick().."> "..CommandToSend.."|")
               sentTo[k]=1
               k:injectChat("Sending")
            end
            sendTable[k] = nil
         end
      end
   end
)
dcpp:setListener( "disconnected", "joinchat", 
   function(h)
      sentTo[h] = nil
   end
)
DC():PrintDebug("Onjoin PM Loaded.")
-------------------------

-BH
Homepage: www.bottledhate.webhop.org

Compiling  Lua scripts is LAME!!!!!

Quicksilver

Thanks a lot, it works great!!!
 :]

SMF spam blocked by CleanTalk