Have Your own "Personal Bot" [LUA]

shockli

Contributor
Jan 29, 2016
243
194
111
Recently I have needed to help people on TeamSpeak out and I've made a script that would help me out a lot with that. This plugin has also become useful to run on a music bot, as it creates a more social experience.

New Features:
!lmgtfy - searches lmgtfy.com (Updated)
!r4p3 - searches r4p3.net
!google - searches google.com
!tpb - searches thepiratebay.se
!kat - search kat.cr
!file - search the following sites:
Mega
Uptobox
Uplea
1fichier
Uploaded
Rapidgator
Turbobit
Keep2share
Bitshare
Filefactory
Free
Oboom
Filepost
Depfile
Firedrive
Mediafire
Uploadable
Hugefiles
ClicknUpload
ZippyShare
Ryushare
2shared
Depositfiles
Purevid
Exashare
Youwatch
Openload
!tf - Search torrentfreak
!ip - search for info on an ip
!whois - get a website whois information
Steam Lobby (thanks FaNNboii - https://r4p3.net/members/fannboii.2241/)


Current Features:
!lmgtfy - searches google
!youtube - Searches youtube
!ud - Urban dictionary
!porn - Searches pornhub
!sc - Searches soundcloud
!wiki - Searches wikipedia
!aw - Searches archlinux wiki
!steam - Searches steam
!drama - Searches encyclopedia dramatica
!ytsearch - Search youtube
!lucky - Google I'm feeling Lucky
!random - Opens rand.pics
!deadpool - Open a link which shows when Deadpool gets released (Implement this for any movie? - I'm attatching some code to use this)
!hapenis - Searches google for "hapenis"
!rtfw - Sends text "read the f****ing wiki"
!9gag - Search 9gag
!imgur - Search imgur

Add more Features:
This whole plugin actually just outputs text! So it's very easy to just add on to it.

Add normal text return:
Code:
  if string.match(message, "!foo") then
     print ("Running random pics for:", message)
     sendMsg = "[color=red]bar[/color]"
     ts3.requestSendChannelTextMsg(serverConnectionHandlerID, sendMsg, channel)
   end

Add a URL that uses a "+ search" system:

Code:
   if string.match(message, "!plus") then
       print ("Running ud for:", message)
     newmsg = string.gsub( message, "!ud", "" )
     newmsg = string.gsub( newmsg, " ", "-" )
     sendMsg = "http://www.whatever.com/define.php?term=" .. newmsg
     sendMsg = string.gsub( sendMsg, "?term=%-", "?term=" )
     sendMsg = "[url]" .. sendMsg .. "[/url]"
     print ("Parsed Link: ", sendMsg)
     ts3.requestSendChannelTextMsg(serverConnectionHandlerID, sendMsg, channel)
     print ("Sent plus link.")
   end

Instructions:
  1. Paste into your plugins/lua_plugin folder
  2. Enable the plugin inside Settings > Plugins > Lua Plugin > lmgtfy

Download V2.2: Here (Fixed Link)
Download V2.1: Here
Download: Here

PHP Code for the Deadpool page:
Code:
<html>

<title>Deadpool Coming in...</title>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<style>
@import "//fonts.googleapis.com/css?family=Bangers";

::selection {
  background: #ff5050; /* WebKit/Blink Browsers */
}
::-moz-selection {
  background: #ff5050; /* Gecko Browsers */
}

body {
    margin: 0;
}

.wrap {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
  height: 100vh;
    background-image: url("deadpool_hi_res_images.jpg");
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

.time-to {
  text-align: center;
  font-family: Bangers;
  color: white;
  font-size: 35px;
  letter-spacing: 2px;
  background: rgba(255,255,255,0.45);
border-radius: 10px;
    padding-top: 15px;
    padding-right: 15px;
    padding-bottom: 15px;
    padding-left: 15px;
    /*height: 300px;
    width: 30%;*/
}
.time-to span {
  display: block;
  font-size: 80px;
  color: red;
}

</style>
<script>
(function () {
    angular.module('app', []).directive('countdown', [
        'Util',
        '$interval',
        function (Util, $interval) {
            return {
                restrict: 'A',
                scope: { date: '@' },
                link: function (scope, element) {
                    var future;
                    future = new Date(scope.date);
                    $interval(function () {
                        var diff;
                        diff = Math.floor((future.getTime() - new Date().getTime()) / 1000);
                        return element.text(Util.dhms(diff));
                    }, 1000);
                }
            };
        }
    ]).factory('Util', [function () {
            return {
                dhms: function (t) {
                    var days, hours, minutes, seconds;
                    days = Math.floor(t / 86400);
                    t -= days * 86400;
                    hours = Math.floor(t / 3600) % 24;
                    t -= hours * 3600;
                    minutes = Math.floor(t / 60) % 60;
                    t -= minutes * 60;
                    seconds = t % 60;
                    return [
                        days + 'd',
                        hours + 'h',
                        minutes + 'm',
                        seconds + 's'
                    ].join(' ');
                }
            };
        }]);
}.call(this));
</script>
<div class='wrap' ng-app='app'>
  <div class='time-to'>
    Deadpool coming in...
    <span countdown='' date='February 12, 2016 09:45:00'>&nbsp;</span>
  </div>
</div>
</html>
 
Last edited:

FaNNboii

Member
Oct 16, 2015
15
4
35
Hey, thanks for the work and info!
I wrote my own Script for Steam Lobby Links.
Code:
local function onTextMessageEvent(serverConnectionHandlerID, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored)
local channel = ts3.getChannelOfClient(serverConnectionHandlerID, fromID)

   if string.match(message, "steam://") then
     sendMsg = "[url]" .. message .. "[/url]"
     ts3.requestSendChannelTextMsg(serverConnectionHandlerID, sendMsg, channel)
  end
end
lmgtfy_events =
{
   onTextMessageEvent = onTextMessageEvent
}

It works now if I or someone else in my channel writes the lobbylink. But is it possible to run it on the server, so that anyone can write it in any channel and it works!?
 

shockli

Contributor
Jan 29, 2016
243
194
111
Hey, thanks for the work and info!
I wrote my own Script for Steam Lobby Links.
Code:
local function onTextMessageEvent(serverConnectionHandlerID, targetMode, toID, fromID, fromName, fromUniqueIdentifier, message, ffIgnored)
local channel = ts3.getChannelOfClient(serverConnectionHandlerID, fromID)

   if string.match(message, "steam://") then
     sendMsg = "[url]" .. message .. "[/url]"
     ts3.requestSendChannelTextMsg(serverConnectionHandlerID, sendMsg, channel)
  end
end
lmgtfy_events =
{
   onTextMessageEvent = onTextMessageEvent
}

It works now if I or someone else in my channel writes the lobbylink. But is it possible to run it on the server, so that anyone can write it in any channel and it works!?
Hey, I don't think you can use LUA for serverquery. Nor can you recode it and have a query client for each channel. What I do recommend though is maybe PM'ing or server chat?

I will be including your function soon (with credits) to a new version!
 

Bluscream

Retired Staff
Contributor
May 8, 2015
967
934
211
Isuggest using
Code:
    --steam lobby (thanks FaNNboii - https://r4p3.net/members/fannboii.2241/)
    if string.match(message, "steam://[^%s]*") then
      sendMsg = "[url]"..string.match(message, "steam://[^%s]*").."[/url]"
     ts3.requestSendChannelTextMsg(serverConnectionHandlerID, sendMsg, channel)
    end
cause with your code if someone writes "steam://273842 asd" it would get transformed into "steam://273842 asd" which is wrong. Nice update btw ^^ Also
Code:
        sendMsg = "https://r4p3.net/search/18031/?q=" .. newmsg
would not work either :p
 

shockli

Contributor
Jan 29, 2016
243
194
111
Isuggest using
Code:
    --steam lobby (thanks FaNNboii - https://r4p3.net/members/fannboii.2241/)
    if string.match(message, "steam://[^%s]*") then
      sendMsg = "[url]"..string.match(message, "steam://[^%s]*").."[/url]"
     ts3.requestSendChannelTextMsg(serverConnectionHandlerID, sendMsg, channel)
    end
cause with your code if someone writes "steam://273842 asd" it would get transformed into "steam://273842 asd" which is wrong. Nice update btw ^^ Also
Code:
        sendMsg = "https://r4p3.net/search/18031/?q=" .. newmsg
would not work either :p
Will fix that up soon :)
 

shockli

Contributor
Jan 29, 2016
243
194
111
Isuggest using
Code:
    --steam lobby (thanks FaNNboii - https://r4p3.net/members/fannboii.2241/)
    if string.match(message, "steam://[^%s]*") then
      sendMsg = "[url]"..string.match(message, "steam://[^%s]*").."[/url]"
     ts3.requestSendChannelTextMsg(serverConnectionHandlerID, sendMsg, channel)
    end
cause with your code if someone writes "steam://273842 asd" it would get transformed into "steam://273842 asd" which is wrong. Nice update btw ^^ Also
Code:
        sendMsg = "https://r4p3.net/search/18031/?q=" .. newmsg
would not work either :p

Awesome - V2.2 released:
  • In process of fixing steam urls
  • Fixed the r4p3 search
  • Fixed thepiratebay search
 

shockli

Contributor
Jan 29, 2016
243
194
111
Bro I cant understand can you please give me the full totorial ??
Because you don't understand I assume you are a windows user ;)
  1. Navigate to C:/Program Files/TeamSpeak 3/plugins/LUA_plugin.
  2. Copy my plugin's files over.
  3. In teamspeak go to settings > plugins >lua_plugin
  4. Enable it (should be close to testmodule and stuff life that)
  5. Test it by trying any of the commands!
I'm sorry if I can't help further today, I'll be in surgery for a while, aswell as when I'm home I'm working on a big new release. I'm sure @Bluescream can help though if you still struggle, he practically recodes all my LUA releases anyway ;)
 

shockli

Contributor
Jan 29, 2016
243
194
111
Wtf this download link, dont know how the fk to download ir
It seems my website has been hacked :/ - problems with using free hosting.. I'll sort it out within the next 3-4 days (not home atm). I wonder if @Bluscream has it lying around?
 

wkesport

Member
Apr 6, 2016
22
7
36
01e5d2f69eba249a70130f8d49f113b7.png

Think the steam:// didn't work :D
 

miszy

Member
Sep 22, 2015
5
0
33
Thanks for share buuut... It nothing happens when i paste it to lua folder and in plugins i turn on that bot. No errors, no messages, commands not works
 

shockli

Contributor
Jan 29, 2016
243
194
111
Thanks for share buuut... It nothing happens when i paste it to lua folder and in plugins i turn on that bot. No errors, no messages, commands not works
What version of TeamSpeak on what os are you running? Did you give the folder the correct name?
 

miszy

Member
Sep 22, 2015
5
0
33
Yeah i named the folder Personal Bot, version 3.0.19.1. Windows 10. For example when i type on chat !ip, !random notjing happens:<
 
Top