Lua Plugin Help! [message #330438] |
Tue, 13 May 2008 18:21 |
HeavyX101- Left
Messages: 633 Registered: April 2008 Location: WindowsJail=ZipFolder
Karma: 0
|
Colonel |
|
|
Hello, i was unable to make this script work on lua plguin.
Could you guys help me please...
function FindWords(Text)
-- This Function Made Soley By PsuFan
-- Please Read The Following Steps/Information Carefully
-- This function finds all the words in the message you send it
-- FirstW, SecondW, SecondPlus, ThirdW, ThirdPlus, and FourthW are whats returned
-- Installation:
-- 1: Copy this sub into your luaplugin.lua at the bottom of the file
-- 2: Add this line to the top of OnChat function > FindWords(Message)
-- Thats it! You can now use FirstW, SecondW, etc in your OnChat function.
-- This function is great for commands like !ban psufan because he sucks
-- !ban <name> <reason>
-- FirstW would equal "!ban"
-- SecondW would equal "psufan" or the <name>
-- Then the reason would be ThirdPlus ("because he sucks") or the <reason>
-- Key:
-- FirstW = First Word
-- SecondW = Second Word
-- SecondPlus = Second Word Till End
-- ThirdW = Third Word
-- ThirdPlus = Third Word Till End
-- FourthW = Fourth Word
-- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-- Please Do Not Edit Beyond This Point, If this function isnt working properly for you,
-- contact PsuFan to assist you. This code is to complicated for you to fix anyway.
-- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Found = string.find(Text, " ")
if Found ~= nil then
FirstW = string.sub(Text, 0, Found - 1)
SecondW = string.sub(Text, Found + 1)
SecondPlus = SecondW
Found = string.find(SecondW, " ")
if Found ~= nil then
ThirdW = string.sub(SecondW, Found + 1)
SecondW = string.sub(SecondW, 0, Found - 1)
ThirdPlus = ThirdW
Found = string.find(ThirdW, " ")
if Found ~= nil then
FourthW = string.sub(ThirdW, Found + 1)
ThirdW = string.sub(ThirdW, 0, Found - 1)
Found = string.find(FourthW, " ")
if Found ~= nil then
FourthW = string.sub(FourthW, 0, Found - 1)
end
else
FourthW = ""
end
else
ThirdW = ""
ThirdPlus = ""
FourthW = ""
end
else
FirstW = Text
SecondW = ""
SecondPlus = ""
ThirdW = ""
ThirdPlus = ""
FourthW = ""
end
end
Sorry that i posted the lua related topic here. People in forums.dcom.productions.net arent visiting that forums alot so i wanted to get some help here.
This account is no longer being active.
[Updated on: Tue, 13 May 2008 18:21] Report message to a moderator
|
|
|
Re: Lua Plugin Help! [message #330442 is a reply to message #330438] |
Tue, 13 May 2008 18:45 |
|
Dave Anderson
Messages: 1953 Registered: December 2004 Location: United States
Karma: 0
|
General (1 Star) |
|
|
If you click my signature you'll find a very helpful forum for this particular subject.
David Anderson
Founder, Software Consultant
DCOM Productions
Microsoft Partner (MSP)
|
|
|
|
Re: Lua Plugin Help! [message #330448 is a reply to message #330438] |
Tue, 13 May 2008 19:28 |
|
Dave Anderson
Messages: 1953 Registered: December 2004 Location: United States
Karma: 0
|
General (1 Star) |
|
|
You obviously underestimate the help you receive from certain small forums. DPDN is the mother of the Lua Plugin and Roshambo is the father (weird metaphore, omg! he mated with DPDN!). We support our own products.
Edit: I didn't notice you said you already visited our forums. But hey, we do sleep, keep that in mind!
David Anderson
Founder, Software Consultant
DCOM Productions
Microsoft Partner (MSP)
[Updated on: Tue, 13 May 2008 19:43] Report message to a moderator
|
|
|
Re: Lua Plugin Help! [message #330455 is a reply to message #330438] |
Tue, 13 May 2008 23:28 |
|
Goztow
Messages: 9743 Registered: March 2005 Location: Belgium
Karma: 14
|
General (5 Stars) Goztoe |
|
|
Heavyx, can you please stop posting every single topic in general discussion. There are subforums for a reason. I really think a long time member as you should at least take the effort to choose the correct subforum. I'm a bit tired of always having to move your topics.
You can find me in The KOSs2 (TK2) discord while I'm playing. Feel free to come and say hi! TK2 discord
|
|
|
Re: Lua Plugin Help! [message #330477 is a reply to message #330455] |
Wed, 14 May 2008 03:39 |
HeavyX101- Left
Messages: 633 Registered: April 2008 Location: WindowsJail=ZipFolder
Karma: 0
|
Colonel |
|
|
Make the Off-Topic forum, then we could post topics that are not related to renegade. Sorry anyway.
This account is no longer being active.
|
|
|
|
Re: Lua Plugin Help! [message #330527 is a reply to message #330480] |
Wed, 14 May 2008 11:41 |
HeavyX101- Left
Messages: 633 Registered: April 2008 Location: WindowsJail=ZipFolder
Karma: 0
|
Colonel |
|
|
But there are other topics I posted that belong in other forums and I posted them in the General Discussion.
If i post this stuff in the Spam Fest section, my topic is going to get infected by rocko!
This account is no longer being active.
|
|
|
Re: Lua Plugin Help! [message #330529 is a reply to message #330438] |
Wed, 14 May 2008 11:57 |
|
Goztow
Messages: 9743 Registered: March 2005 Location: Belgium
Karma: 14
|
General (5 Stars) Goztoe |
|
|
This stuff should obviously go in the mod forum, where I moved it to.
You can find me in The KOSs2 (TK2) discord while I'm playing. Feel free to come and say hi! TK2 discord
|
|
|
|