ApexDC++ Forums: Lua Plugin 1.3 Beta - ApexDC++ Forums

Jump to content

Welcome Guest! You are viewing in reduced service mode. To remove ads and receive the full benefits to our forums, please register or login.

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

Lua Plugin 1.3 Beta

#1 User is offline   Lee 

  • Project Manager
  • Group: Management
  • Posts: 2,794
  • Joined: 19-January 06

Posted 24 December 2008 - 08:36 PM

The Lua Plugin comes equipped with multiple different script files that will be useful for 1.2.0 users.

How it install

Simply extract the rar file to the root ApexDC++ folder, so the plugins and script folders are below it.

Download: New version is here. :)
Lee

ApexDC++ Manager

#2 User is offline   andyevil 

  • Newbie
  • Pip
  • Group: Member
  • Posts: 4
  • Joined: 24-December 08

Posted 24 December 2008 - 09:29 PM

don't see any changes after loading. Why?
maybe some kind of manual will be posted here?

#3 User is offline   Crise 

  • Developer
  • Group: Management
  • Posts: 2,748
  • Joined: 19-January 06

Posted 24 December 2008 - 10:04 PM

View Postandyevil, on Dec 24 2008, 10:29 PM, said:

don't see any changes after loading. Why?
maybe some kind of manual will be posted here?


If you do it correctly then the LUA plugin should tell you to restart ApexDC++ since the LUA plugin specifically is built so that it has to be present from the very start of the session (or rather startup.lua has been made in that manner).
Crise
ApexDC++ - Lead Developer

Proud Affiliates of: TechGeeks Online, PeerWeb

#4 User is offline   andyevil 

  • Newbie
  • Pip
  • Group: Member
  • Posts: 4
  • Joined: 24-December 08

Posted 25 December 2008 - 07:08 PM

yep, it said about restart.
I've restarted apexdc, and see to changes.

#5 User is offline   The1Dude 

  • Newbie
  • Pip
  • Group: Member
  • Posts: 12
  • Joined: 29-November 07

Posted 25 December 2008 - 07:49 PM

Is there any documentation for this plugin?

What exactly does it do?
Let me explain something to you. Um, I am not "Mr. Lebowski". You're Mr. Lebowski. I'm the Dude. So that's what you call me. You know, that or, uh, His Dudeness, or uh, Duder, or El Duderino if you're not into the whole brevity thing.
-- The Dude [The Big Lebowsky]

#6 User is offline   adrian_007 

  • Advanced
  • PipPipPip
  • Group: Member
  • Posts: 86
  • Joined: 30-July 06

Posted 25 December 2008 - 09:49 PM

provides bcdc++ compatible scripting api

#7 User is offline   Crise 

  • Developer
  • Group: Management
  • Posts: 2,748
  • Joined: 19-January 06

Posted 25 December 2008 - 09:52 PM

basically, if you don't know what LUA is then this won't be of much use to you...
Crise
ApexDC++ - Lead Developer

Proud Affiliates of: TechGeeks Online, PeerWeb

#8 User is offline   en_dator 

  • Swedish Translator
  • Group: Translator
  • Posts: 127
  • Joined: 19-September 06

Posted 25 December 2008 - 09:53 PM

andyevil ,
the lua plugin is a way of running lua scripts in the client. If you do not load any scripts - there will not be any difference.

#9 User is offline   andyevil 

  • Newbie
  • Pip
  • Group: Member
  • Posts: 4
  • Joined: 24-December 08

Posted 25 December 2008 - 09:54 PM

ok, just tell me how? =)
I don't see anything new (I do not mean Plugins etc) about lua.
How to load scripts? What is scripts api?

#10 User is offline   mappy 

  • Newbie
  • Pip
  • Group: Member
  • Posts: 18
  • Joined: 26-December 08

Posted 26 December 2008 - 01:33 AM

possibly not doing this right, but is startup.lua even parsed?
typing 'bier', '/uptime show' etc and the things that the scripts specify, don't seem to have any effect..

#11 User is offline   Crise 

  • Developer
  • Group: Management
  • Posts: 2,748
  • Joined: 19-January 06

Posted 26 December 2008 - 11:17 AM

View Postmappy, on Dec 26 2008, 01:33 AM, said:

possibly not doing this right, but is startup.lua even parsed?
typing 'bier', '/uptime show' etc and the things that the scripts specify, don't seem to have any effect..


Quote

[13:16:28] <ADCPortal Support Hub> (uptime.lua) /uptime [show]
[13:16:29] <ADCPortal Support Hub> (adccommands.lua) /nick <nick>


It is parsed... I have just commented out all the includes at the bottom of startup.lua by default...
Crise
ApexDC++ - Lead Developer

Proud Affiliates of: TechGeeks Online, PeerWeb

#12 User is offline   andyevil 

  • Newbie
  • Pip
  • Group: Member
  • Posts: 4
  • Joined: 24-December 08

Posted 27 December 2008 - 07:02 PM

That's it!
I've uncomented load of some scripts and yahoo! it works!
thx.

btw, I think you should add info about it somewhere :)

#13 User is offline   Patch 

  • Member
  • PipPip
  • Group: Member
  • Posts: 46
  • Joined: 25-February 06

Posted 31 December 2008 - 01:35 PM

I placed the folders, then run apexdc, after that i see the Clientside lua scripting on the plugins menu, but nothing more happens. I guess, the startup.lua script start other scripts witch in the \Scripts folder, but it won't do...

If i will write a new script, i had to place it to the script folder, but if i want to start it, i shoud edit the end of the startup.lua file like this?

--dofile( DC():GetAppPath() .. "scripts\\myscript.lua" )



I will try to write an antispam script, because the ignore command not work on bots, and after several years of DC usage, i simply don't want to get PM's like "/fav" or advertisments...

#14 User is offline   Crise 

  • Developer
  • Group: Management
  • Posts: 2,748
  • Joined: 19-January 06

Posted 31 December 2008 - 06:06 PM

the "--" make the line a comment, so in order to load a script you should type the line without those...
Crise
ApexDC++ - Lead Developer

Proud Affiliates of: TechGeeks Online, PeerWeb

#15 User is offline   Patch 

  • Member
  • PipPip
  • Group: Member
  • Posts: 46
  • Joined: 25-February 06

Posted 31 December 2008 - 09:25 PM

View PostCrise, on Dec 31 2008, 07:06 PM, said:

the "--" make the line a comment, so in order to load a script you should type the line without those...


OMG, i won't see that! :blushing:


Tryd without te --, but nothing seems to be changed.

#16 User is offline   Daywalker 

  • Newbie
  • Pip
  • Group: Member
  • Posts: 1
  • Joined: 21-August 07

Posted 01 January 2009 - 02:32 PM



#17 User is offline   en_dator 

  • Swedish Translator
  • Group: Translator
  • Posts: 127
  • Joined: 19-September 06

Posted 01 January 2009 - 08:46 PM

Patch

you should look into the scripts folder, there is one called ignore.lua, maybe that does what you want

#18 User is offline   Patch 

  • Member
  • PipPip
  • Group: Member
  • Posts: 46
  • Joined: 25-February 06

Posted 01 January 2009 - 10:45 PM

View Posten_dator, on Jan 1 2009, 09:46 PM, said:

Patch

you should look into the scripts folder, there is one called ignore.lua, maybe that does what you want


"ignore.lua -- makes possible to (un)ignore someone from the chat"
It's works from an ignorelist. Witch i mentioned is scan the pm text for unwanted words like viagra,sex,fav or too mutch lines...

#19 User is offline   Patch 

  • Member
  • PipPip
  • Group: Member
  • Posts: 46
  • Joined: 25-February 06

Posted 02 January 2009 - 02:25 PM

There is one kind of antispam filter, witch monitorize the nubmer of lines in pm, and if the number is biger than 1, it's block the PM, and put it's sender's nick and the massage to the main chat of the sender's hub. (not sends, just you will see)

When i'm usingDC++, i'm online in 25-30 hubs, that means 15 unwanted PM's. The script i uplaoaded (why can't upload .lua diretctly?) is block 12 PM from 15. Not bad for first try, but it's need some work...

I think it will be good an on/off switch, max line definition "on the fly", word search (/fav). So if someboy have ideas, pls. post it.


The script tested on actual version of bcdc++ EDIT: works with ApexDC++ 1.2.0b!!! - pictures included

--based on lwolf's script, edited by Patch 
local maxline = 2
local hubtofilter = ""

dcpp:setListener( "pm", "antispam",
function( hub, user, text )
 local ret = false
 if string.find(string.lower(hub:getHubName()),hubtofilter) then

	 local sorveg = 0
	 if string.find(text,"\n") then
		local fpos = 1
		local apos = 0
	  while fpos do
	   apos = apos + 1
	   fpos = string.find(text,"\n",apos)
	   apos = fpos
		 sorveg = sorveg + 1
	   if sorveg >= maxline then
		ret = true
		hub:addLine("PM blocked from "  .. DC():ToUtf8(user:getNick()) .." **" )
		hub:injectChat("PM text: "  .. text .." **" )
		DC():PrintDebug( "  ** " .. "PM blocked from "  .. DC():ToUtf8(user:getNick()) .." **" )
		break
	   end
	  end -- while end
	   end
 end
return ret
end
)

DC():PrintDebug( "  ** Loaded anti-spam filter v0.1 **" )


edit:
Atached file deleted, because there is the version 0.2 in the other topic...

Attached File(s)



#20 User is offline   DerSizeS 

  • Newbie
  • Pip
  • Group: Member
  • Posts: 2
  • Joined: 17-January 09

Posted 19 January 2009 - 12:41 PM

So...
anybody have some .hlp files or how to's to luaplugin?

Sample how to send msg to chat without script ...

/lua hub:sendchat(os.time());


?

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked