PtokaX forum

Lua 5.3/5.2/5.1 Scripts (for PtokaX 0.4.0.0 and newer) => Conversion Requests => Topic started by: popescuionut on 06 December, 2011, 21:28:19

Title: Help with conversion of this script, please
Post by: popescuionut on 06 December, 2011, 21:28:19
Please if you can help me to convert this script to version 0.4.1.1 and 0.4.1.2. When the upload script gives me the message \ \ scripts \ \ AscIIArtBot.lua_5.lua: 26: Attempt to call method \ 'SendData \' (a nil value). Like other versions of the script that I found here, and when I run a command, is my nick. For example if I command + PC does not appear as I want:

<Dracusorul>


_
?  ?                               
?  ? = = = ( )=     /////                               
?_?          ? ? ?     ? o o ?               Die fucking PC !!!     
               ? ? ?   (  c   )                     ____
                ? ? ? \\ =  /                    ??        \\_
                   ? ? ? ? ? ?                       ??             ?
                   ? ? ? ? ? ?                  .....??___/?---''
                   ? ? ? ? ? ?             __?_______?____
                      ? ? ?             ?______________?
                      ? ? ?              ? ?  ? ?              ? ?  ? ?
                      ? ? ?              ? ?  ? ?              ? ?  ? ?
---------------------? ? ?--------------? ?--l l--------------? ?--l-l-----

No image appears only Nick and I want to come and nick one who gives the order.



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

Bot = "[PB]Ares"   -- your main bot here
CDFolder = Core.GetPtokaXPath().."scripts/text" -- make folder in your scripts put your ascii there
SendComm = 1    -- Send user command [right click] "1"=yes "0"=no
tMenu = "????????" -- ArtBotMenu Name

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

--$UserCommand 1 X  Where -> 1=Hub Menu 2=User Menu 3=Hub/User Menu
--
function UserConnected(user)
if SendComm == 1 and SetTo[user.iProfile] == 1 then
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\LOL$<%[mynick]> +lol&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Rasta$<%[mynick]> +rasta&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Toast$<%[mynick]> +toast&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Toilet$<%[mynick]> +toilet&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Truck$<%[mynick]> +Truck&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Devil$<%[mynick]> +devil&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Sleep$<%[mynick]> +sleep&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\GoodNight$<%[mynick]> +goodnight&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Dance$<%[mynick]> +dance&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Rabbit$<%[mynick]> +rabbit&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\GoodMorning$<%[mynick]> +goodmorning&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Cookie$<%[mynick]> +cookie&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Hub$<%[mynick]> +hub&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Nice Girl$<%[mynick]> +nicegirl&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\DreamLand$<%[mynick]> +dreamland&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Horse$<%[mynick]> +horse&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Spam$<%[mynick]> +spam&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Bye$<%[mynick]> +bye&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Hello$<%[mynick]> +hello&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Luv$<%[mynick]> +luv&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Play$<%[mynick]> +play&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Rose I$<%[mynick]> +rose&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Rose II$<%[mynick]> +rose2&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Kiss$<%[mynick]> +kiss&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Gnight$<%[mynick]> +gnight&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Lucky$<%[mynick]> +lucky&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Beer$<%[mynick]> +beer&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Faker$<%[mynick]> +faker&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Coffee$<%[mynick]> +coffee&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Flower$<%[mynick]> +flower&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\FunHub$<%[mynick]> +funhub&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Peuk$<%[mynick]> +peuk&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Kissy$<%[mynick]> +kissy&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Gone$<%[mynick]> +gone&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Party$<%[mynick]> +party&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\HappyBirthday$<%[mynick]> +happybirthday&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Hanging$<%[mynick]> +hanging&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Bbl$<%[mynick]> +bbl&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\ItsMe$<%[mynick]> +itsme&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\I Am Busy$<%[mynick]> +busy&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\Fix Pc$<%[mynick]> +pc&#124;|")
Core.SendToNick(user.sNick,"$UserCommand 1 3 "..tMenu.."\\happynewyear$<%[mynick]> +ng&#124;|")
end
end

OpConnected = UserConnected

function OnStartup()
   
end

function ChatArrival(user,data)
Core.GetUserAllData(user)
   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 true
      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
Core.SendToAll(user.sNick.."\r\n"..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
    Core.SendPmToNick(user.sNick,Bot, lines.." |")
end
RegConnected = UserConnected


Thank you.




EDIT: Please Learn to use Code Tags, it makes these things much easier to decypher - PC
Title: Re: Help with conversion of this script, please
Post by: the-master on 09 December, 2011, 10:40:17
1. This script works fine on latest hubsoft, guess you're the one with errors  ;D
2. Theres no "SendData" command in this script...