Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Lua Plugin Help!
Lua Plugin Help! [message #330438] Tue, 13 May 2008 18:21 Go to next message
HeavyX101- Left is currently offline  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 Go to previous messageGo to next message
Dave Anderson is currently offline  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 #330443 is a reply to message #330442] Tue, 13 May 2008 18:53 Go to previous messageGo to next message
HeavyX101- Left is currently offline  HeavyX101- Left
Messages: 633
Registered: April 2008
Location: WindowsJail=ZipFolder
Karma: 0
Colonel
As I said, there are not alot of people that are visiting that forum so i dontget help easily, but i have posted a topic there.
This is where i posted the topic.
http://forums.dcomproductions.net/viewtopic.php?f=14&t=859



This account is no longer being active.
Re: Lua Plugin Help! [message #330448 is a reply to message #330438] Tue, 13 May 2008 19:28 Go to previous messageGo to next message
Dave Anderson is currently offline  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. Wink 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. Wink

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 Go to previous messageGo to next message
Goztow is currently offline  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 Go to previous messageGo to next message
HeavyX101- Left is currently offline  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. Smile Sorry anyway.

This account is no longer being active.
Re: Lua Plugin Help! [message #330480 is a reply to message #330438] Wed, 14 May 2008 04:51 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
but this IS related to renegade.
Re: Lua Plugin Help! [message #330527 is a reply to message #330480] Wed, 14 May 2008 11:41 Go to previous messageGo to next message
HeavyX101- Left is currently offline  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! Sarcasm


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 Go to previous messageGo to next message
Goztow is currently offline  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
Re: Lua Plugin Help! [message #330530 is a reply to message #330438] Wed, 14 May 2008 13:33 Go to previous message
Lone0001 is currently offline  Lone0001
Messages: 2112
Registered: August 2006
Location: Ontario, Canada
Karma: 0
General (2 Stars)

Imo It could go in several places, Win32 forum(since the Lua plugin is a plugin for SSGM which is a renfds server manager), I also think it could go in the "Other Products" section also.

Previous Topic: Can someone edit Hourglass slightly for me
Next Topic: were i get firstpersone view gun thing like
Goto Forum:
  


Current Time: Fri Jan 10 21:37:37 MST 2025

Total time taken to generate the page: 0.01389 seconds