Author Topic: ASCII Art Text Help  (Read 3757 times)

0 Members and 1 Guest are viewing this topic.

Offline Ninjutsu

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
  • Welcome to my world!
    • Rafal Works
ASCII Art Text Help
« on: 28 December, 2008, 19:34:45 »
Hello!
I'm reading the forum for a while, and I found some interesting scripts here.

I have a request. I know this help for the lua 5.1 is closed (I'm still using PtokaX v0.3.6), but I got this script: ASCII Art Bot (TiMeTrAVelleRs Version) and is working well, but I need an extra feature in it: when I call the ASCII file (whatever command it is, ex: +beer), I want to be able to offer this beer to somebody ( ex: +beer Ninjutsu). I've got another great script, called FunScript v8 (by Madman) that has this function, and I tried to get the code from that script but with no results... I saw there (in FunScript) that the ASCII file has some text in it, ex: [curuser] gives [vic] some Acid enjoy!!!, where these are replaced with the nick of the person who call the command and the other with de victim's nick.
Can anyone make these command in the ASCII Art Bot?

Many thanks in advance!

Here's the script:
Code: [Select]

-- LUA 5
--04/03/05
--TiMeTrAVelleRs Version

Bot = frmHub:GetHubBotName()   -- your main bot here
CDFolder = "text" -- make folder in your scripts put your ascii there
SendComm = 1    -- Send user command [right click] "1"=yes "0"=no
tMenu = "Rafal Works Hub\\? Desen ASCII" -- ArtBotMenu Name

SetTo = {
 [0] = 1,   -- Masters
 [1] = 1,   -- Operators
 [2] = 1,   -- Vips
 [3] = 1,   -- Regs
 [4] = 1,   -- Moderator
 [5] = 1,   -- NetFounder
 [-1] =0,   -- Users
}
--------------------------------------------------------------------------------------------------------------------

--$UserCommand 1 X  Where -> 1=Hub Menu 2=User Menu 3=Hub/User Menu
--
function NewUserConnected(user)
if SendComm == 1 and SetTo[user.iProfile] == 1 then
user:SendData("$UserCommand 1 3 "..tMenu.."\\Ursulet$<%[mynick]> +bear&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Bere$<%[mynick]> +beer&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Posta$<%[mynick]> +bike&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Revin$<%[mynick]> +brb&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Sunt ocupat$<%[mynick]> +busy&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\La revedere$<%[mynick]> +bye&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\La multi ani$<%[mynick]> +cake&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Clovn$<%[mynick]> +clown&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Dragon$<%[mynick]> +dragon&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Vise placute$<%[mynick]> +dream&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Paste fericit$<%[mynick]> +easter&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Fara fake$<%[mynick]> +fake&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\MotherFaker$<%[mynick]> +faker&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Gaze$<%[mynick]> +fart&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Nu sunt aici$<%[mynick]> +gone&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Sunt fericit$<%[mynick]> +happy&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Vultur$<%[mynick]> +hawk&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Inima mea$<%[mynick]> +heart&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Salut$<%[mynick]> +hello&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Imbratisare$<%[mynick]> +hug&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Ma grabesc$<%[mynick]> +hurry&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Te sarut$<%[mynick]> +kiss&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\LOL$<%[mynick]> +lol&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Te iubesc$<%[mynick]> +luv&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Buna dimineata$<%[mynick]> +morning&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Noapte buna$<%[mynick]> +night&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Iepuras$<%[mynick]> +rabbit&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Repornesc PC$<%[mynick]> +reboot&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Trandafir$<%[mynick]> +rose&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Zambet$<%[mynick]> +smile&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Sarpe$<%[mynick]> +snake&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Fara spam$<%[mynick]> +spam&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Toast$<%[mynick]> +toast&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Internet$<%[mynick]> +web&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Bine ati venit$<%[mynick]> +welcome&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Sarbatori Fericit$<%[mynick]> +xmas&#124;|")
user:SendData("$UserCommand 1 3 "..tMenu.."\\Craciun Fericit$<%[mynick]> +xtree&#124;|")
end
end

OpConnected = NewUserConnected

function Main()
   frmHub:RegBot(Bot)
end

function ChatArrival(user, data)
   data=string.sub(data,1,string.len(data)-1)
   if( string.sub(data, 1, 1) == "<" ) then
      s,e,cmd = string.find(data,"%b<>%s+(%S+)")
      cmd = string.sub(cmd, 1,string.len(cmd))
      if io.open(CDFolder.."/"..cmd..".txt",r) ~= nil then
         showtext(user, cmd)
         return 1
      end
   end
end

function showtext(user, file)
local contents ="\r\n\r\n"
for line in io.lines(CDFolder.."/"..file..".txt") do
    contents = contents..line.."\r\n"
    end
SendToAll(user.sName.." "..contents.."\r\n|")
end

function showtextold(user, cmd)
local lines="\r\n\r\n"
    for line in io.lines(file) do
        lines = lines..line.."\r\n"
    end
    user:SendPM(Bot, lines.." |")
end


And there is the ASCII beer example:



            !!!!!!!!!
             !!!!!!!
             !!!!!!!
             !!!!!!!
            !!!!!!!!!         This beer is from [curuser] to [vic]!!!
           !!!!!!!!!!!
          !!!!!!!!!!!!!
         !!!!!!!!!!!!!!!
        !!!!!!!!!!!!!!!!!                _______
        !               !               !              !
        !               !               !              !
        !               !               !!!!!!!!!!!!!!!! 
        !               !               !!!!!!!!!!!!!!!!
        !!!!!!!!!!!!!!!!!               !!!!!!!!!!!!!!!!
        !!!!!!!!!!!!!!!!!               !!!!!!!!!!!!!!!!
        !!!!!!!!!!!!!!!!!               !!!!!!!!!!!!!!!!
        !!!!!!!!!!!!!!!!!               !!!!!!!!!!!!!!!!   
        !!!!!!!!!!!!!!!!!               !!!!!!!!!!!!!!!!

Our greatest glory is not in never failing, but in rising each time we fall.


PtokaX forum

ASCII Art Text Help
« on: 28 December, 2008, 19:34:45 »

Offline Ninjutsu

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
  • Welcome to my world!
    • Rafal Works
Re: ASCII Art Text Help
« Reply #1 on: 06 January, 2009, 17:02:53 »
Thank you American Idiot for your fast answer and help!
It is working very well, and I'm satisfied 100% with the result.

Great job!!! And many thanks!!!

Respect!
Our greatest glory is not in never failing, but in rising each time we fall.


PtokaX forum

Re: ASCII Art Text Help
« Reply #1 on: 06 January, 2009, 17:02:53 »