Jump to content


Lua Plugin 1.3 Beta


39 replies to this topic

#21 en_dator

    Swedish Translator

  • Translator
  • 131 posts

Posted 21 January 2009 - 10:24 PM

There are some scripts included with the client, the startup.lua will give you many hints, and most of the others are good for education as well.

#22 DerSizeS

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 22 January 2009 - 03:04 PM

startup.lua contain help only for listeners.

#23 en_dator

    Swedish Translator

  • Translator
  • 131 posts

Posted 22 January 2009 - 05:58 PM

look in function createAdcHub( hubid ) and createNmdcHub( hubid )

#24 Yeppy

    Member

  • Member
  • PipPip
  • 33 posts

Posted 24 January 2009 - 10:37 AM

ok so if i get this right i can use any lua script from rsx++ in apex right ?
or is lua different in this one ?

#25 Yeppy

    Member

  • Member
  • PipPip
  • 33 posts

Posted 24 January 2009 - 04:03 PM

what lua version do you use for this ?

**Edit : lua 5.1 (tnx Plop)

#26 en_dator

    Swedish Translator

  • Translator
  • 131 posts

Posted 25 January 2009 - 09:56 AM

yes, as far as I can tell, all scripts that work in last versions of rsx and bcdc works in apex too (some small modifications might be needed depending on what startup.lua you are using)

#27 Yeppy

    Member

  • Member
  • PipPip
  • 33 posts

Posted 25 January 2009 - 11:50 AM

not all of them. or at least not the way they should. for example the matrix script in rsx++ works like a charm no matter what version of the script i use.

but it doesn't work ok in apex. at best i can trigger it but in some hubs like Geek-Op i get kicked for supplying a different nickname. my correct nick is [Vatosâ?¢]Yeppy but the script sends [Vatos]Yeppy.
so the â?¢ is missing so i get a kick.

i attached all 3 versions so you can have a look if you want

matrix-1 (oldest)works ok in rsx but changes my nick in apex by removing the â?¢

matrix-2 (last by szmeby) works ok in rsx but changes my nick in apex by removing the â?¢

matrix-3 (lua5.1 version by ATAG) works ok in rsx but in apex i get *** Unknown command: matrix

Attached Files



#28 LadyStardust

    Polish Translator

  • Translator
  • 49 posts

Posted 25 January 2009 - 01:03 PM

About matrix-3.lua ...
In your client tick option:
Settings/Advanced/Send unknown / commands to the hub
restart, load the script and type /matrix text

#29 Yeppy

    Member

  • Member
  • PipPip
  • 33 posts

Posted 25 January 2009 - 04:08 PM

ok command is sent but doesn't fix the problem. still removes the â?¢ from my nick and that ain't good

#30 LadyStardust

    Polish Translator

  • Translator
  • 49 posts

Posted 25 January 2009 - 05:30 PM

Afaik â?¢ is non-letter character , and script doesnt recognise it and sends your nick without it and you get kicked. Same if you will try to send â?¢ as text after the command /matrix it will not send it at all. Script would need the function to display this character.

#31 Yeppy

    Member

  • Member
  • PipPip
  • 33 posts

Posted 25 January 2009 - 05:32 PM

but how come rsx sends it perfectly ?

#32 LadyStardust

    Polish Translator

  • Translator
  • 49 posts

Posted 25 January 2009 - 06:06 PM

different API I would say. You need someone who will adjust the script. Ex I've got completely different matrix.lua for zK atm

#33 adrian_007

    Advanced

  • Member
  • PipPipPip
  • 87 posts

Posted 25 January 2009 - 09:48 PM

well, i'd say bad encoding in plugin -> client and client -> plugin way :)

#34 Crise

    Developer

  • Management
  • 2,844 posts

Posted 26 January 2009 - 05:37 AM

View Postadrian_007, on Jan 25 2009, 10:48 PM, said:

well, i'd say bad encoding in plugin -> client and client -> plugin way :)

Not a big surprise that, tbh..
Crise
ApexDC++ - Lead Developer

Proud Affiliates of: TechGeeks Online, PeerWeb

#35 adrian_007

    Advanced

  • Member
  • PipPipPip
  • 87 posts

Posted 26 January 2009 - 08:48 PM

hehe it's a nasty bug, but i found a quite nice solution for it
every string that goes outide the core is in utf8 - no matter if this comes from adc or nmdc :) and when sending, nmdc decode it (adc leave it as is). imo best solution :)
it's already implemented in latest build of rsx++ and works like a charm in lua ^^

#36 Crise

    Developer

  • Management
  • 2,844 posts

Posted 28 January 2009 - 12:55 PM

solved this little issue with the ™ char, luckily it had nothing to do with string encoding, but stupid mistake anyways...

Edit: also those missing the timer that has been fixed also and was also a stupid mistake, even more so than this one...
Crise
ApexDC++ - Lead Developer

Proud Affiliates of: TechGeeks Online, PeerWeb

#37 Yeppy

    Member

  • Member
  • PipPip
  • 33 posts

Posted 28 January 2009 - 04:56 PM

so if it's fixed will it be available in the next version of the plugin ?

#38 Crise

    Developer

  • Management
  • 2,844 posts

Posted 28 January 2009 - 09:13 PM

View PostYeppy, on Jan 28 2009, 05:56 PM, said:

so if it's fixed will it be available in the next version of the plugin ?

That would be a correct assumption... and before you ask when that would be with b2 or final depending which it is that will be coming...
Crise
ApexDC++ - Lead Developer

Proud Affiliates of: TechGeeks Online, PeerWeb

#39 Sergeo7

    Advanced

  • Member
  • PipPipPip
  • 68 posts

Posted 20 February 2009 - 01:37 AM

View Postadrian_007, on Jan 26 2009, 08:48 PM, said:

every string that goes outide the core is in utf8 - no matter if this comes from adc or nmdc :) and when sending, nmdc decode it (adc leave it as is). imo best solution :)
I think so too. That mess with the different encodings in some places is really troublesome. When will you release this patch to a public?

BTW can I ask if the next idea will ever work with this? Somehow data (3-byte kanji characters) were transmitted and utf-8 encoding were restored in spite of NMDC-hub, but the only place, where they displayed correctly, was status-bar.
--// skipping superfluous code..

dcpp:setListener( "ownChatOut", "encodeUTF8",
	function( hub, text )
		DC():PrintDebug( "  ** Sent: "..text)
		if string.find( text, "[^%z\1-\127\194-\244][^\128-\191]*") then
			DC():SendHubMessage( hub:getId(), "<"..hub:getOwnNick().."> "..DC():FromUtf8(utf8_url_encode(text)).."|" )
			DC():PrintDebug( "  ** Encoded: "..text)
			return 1
		end
	end
)

dcpp:setListener( "chat", "decodeUTF8",
	function( hub, user, text )
		DC():PrintDebug( "  ** Received: "..text)
		if string.find( text, "%%([a-fA-F0-9]+)%+") then
			text = url_utf8_decode(text)
			--Displays 3-byte chars incorrectly in the main chat, (2-bytes still ok).
			DC():InjectHubMessage( hub:getId(), "<"..user._nick.."> "..text ) 
 			--Displays correctly.
			DC():PrintDebug( "  ** Decoded: "..text)
			return 1
		end
	end																			
)


#40 Lee

    Project Manager

  • Management
  • 3,198 posts

Posted 12 April 2009 - 01:11 PM

Closed... please use the new version.
Stay up to date: Subscribe to our news feed





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users