Jump to content


Lua Plugin 1.3 Beta


39 replies to this topic

#1 Lee

    Project Manager

  • Management
  • 3,198 posts

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. ;)
Stay up to date: Subscribe to our news feed

#2 andyevil

    Newbie

  • Member
  • Pip
  • 4 posts

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 Crise

    Developer

  • Management
  • 2,844 posts

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 andyevil

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 25 December 2008 - 07:08 PM

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

#5 The1Dude

    Newbie

  • Member
  • Pip
  • 12 posts

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 adrian_007

    Advanced

  • Member
  • PipPipPip
  • 87 posts

Posted 25 December 2008 - 09:49 PM

provides bcdc++ compatible scripting api

#7 Crise

    Developer

  • Management
  • 2,844 posts

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 en_dator

    Swedish Translator

  • Translator
  • 131 posts

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 andyevil

    Newbie

  • Member
  • Pip
  • 4 posts

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 mappy

  • Member
  • PipPip
  • 43 posts

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..
My Projects: jmDC | More

#11 Crise

    Developer

  • Management
  • 2,844 posts

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 andyevil

    Newbie

  • Member
  • Pip
  • 4 posts

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 :blushing:

#13 Patch

    Member

  • Member
  • PipPip
  • 47 posts

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 Crise

    Developer

  • Management
  • 2,844 posts

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 Patch

    Member

  • Member
  • PipPip
  • 47 posts

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! ;)


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

#16 Daywalker

    Newbie

  • Member
  • Pip
  • 1 posts

Posted 01 January 2009 - 02:32 PM

Hi there guys, long see no time >.<

dunno if it is reported yet but i noticed that the timer isn't working yet

and for the rest keep up the good work lua is good to have in a client ;-)

geetings Daywalkerâ?¢

#17 en_dator

    Swedish Translator

  • Translator
  • 131 posts

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 Patch

    Member

  • Member
  • PipPip
  • 47 posts

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 Patch

    Member

  • Member
  • PipPip
  • 47 posts

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 Files



#20 DerSizeS

    Newbie

  • Member
  • Pip
  • 2 posts

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());

?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users