PtokaX forum

Archive => Archived 5.1 boards => Conversion Requests => Topic started by: tom_cruise4g on 13 February, 2007, 18:19:20

Title: [22:40] Syntax C:\Downloads\0.3.5.2\scripts\Funscript2.2-Ops.lua:149: attempt to
Post by: tom_cruise4g on 13 February, 2007, 18:19:20
hi

first of all tell u ..i am a newbie
i dont know ant thing except some basics

i tried to used some bots like joke bot but no jokes are runned even when after starting the script
the messsage comes under s as
[22:40] Syntax C:\Downloads\0.3.5.2\scripts\Funscript2.2-Ops.lua:149: attempt to call global 'getn' (a nil value)
plz help....... :-[
Title: Re: [22:40] Syntax C:\Downloads\0.3.5.2\scripts\Funscript2.2-Ops.lua:149: attempt to
Post by: Leun on 13 February, 2007, 19:09:19
change

table.getn


into

table.maxn


good luck :-)
Title: Re: [22:40] Syntax C:\Downloads\0.3.5.2\scripts\Funscript2.2-Ops.lua:149: attempt to
Post by: tom_cruise4g on 13 February, 2007, 19:28:20
Quote from: Leun on 13 February, 2007, 19:09:19
change

table.getn


into

table.maxn


good luck :-)
Title: Re: [22:40] Syntax C:\Downloads\0.3.5.2\scripts\Funscript2.2-Ops.lua:149: attempt to
Post by: bastya_elvtars on 13 February, 2007, 19:34:52
OMFG, post the script in text please. This is by the way Lua4.
Title: Re: [22:40] Syntax C:\Downloads\0.3.5.2\scripts\Funscript2.2-Ops.lua:149: attempt to
Post by: tom_cruise4g on 13 February, 2007, 19:47:56
Quote from: bastya_elvtars on 13 February, 2007, 19:34:52
OMFG, post the script in text please. This is by the way Lua4.


iInterval = 120; -- in minutes
sBotName = "TimeAnnouncer";

iState = 0;

function Main()
  iState = 2;
  SetTimer(60 * 1000);
  StartTimer();
end

function OnTimer()
  if (iState == 1) then
    SendToAll(sBotName, "It's "..date("%H:%M").." o'clock.");
  elseif (iState == 2 and mod(date("%M") + iInterval, iInterval) == 0) then
    SetTimer(iInterval * 60 * 1000);
    iState = 1;
    SendToAll(sBotName, "It's "..date("%H:%M").." o'clock @ UK-Hubs Safehouse ;-)");
  end
end


the error which iamm getting s
[00:10] Syntax C:\Downloads\0.3.5.2\scripts\time.lua:15: attempt to call global 'date' (a nil value)

Plz see the screeen shot bellow & also the error
Title: Re: [22:40] Syntax C:\Downloads\0.3.5.2\scripts\Funscript2.2-Ops.lua:149: attempt to
Post by: bastya_elvtars on 13 February, 2007, 20:44:22
iInterval = 120; -- in minutes
sBotName = "TimeAnnouncer";

iState = 0;

function Main()
  iState = 2;
  SetTimer(60 * 1000);
  StartTimer();
end

function OnTimer()
  if (iState == 1) then
    SendToAll(sBotName, "It's "..os.date("%H:%M").." o'clock.");
  elseif (iState == 2 and math.modf(os.date("%M") + iInterval, iInterval) == 0) then
    SetTimer(iInterval * 60 * 1000);
    iState = 1;
    SendToAll(sBotName, "It's "..os.date("%H:%M").." o'clock @ UK-Hubs Safehouse ;-)");
  end
end

Moved to ConversionRequests.