determinate determinate

Author Topic: Major problem running LUA-scripts  (Read 809 times)

0 Members and 1 Guest are viewing this topic.

Offline Buhmann

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Major problem running LUA-scripts
« on: September 08, 2010, 12:33:46 pm »
Hi everyone!
I'm running Ptokax 0.4.1.2 in GUI version.
I've been trying to run some LUA 5.1-scripts, but i can't get it working.
In the scripts-menu, all scripts are checked, none has any syntax errors. The script memory usage menu shows all 3 scripts runningAs admin client, I can start, stop and reload any of those scripts, followed by the standard status message "*** admin restarted script: x.lua".

However, none of the script bots appear in the userlist, and i can't use the script's commands.
So far, I've tried RecordBot-v.0.95.lua, simpsons.lua, RecordBot.lua, Chat_History_1.03_L5.1.lua and some others.
Can anyone tell me why the scripts won't start? (In fact, the hub says, they are running, but still, the bots don't appear :( )

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 245
  • Karma: +206/-17
  • PtokaX "developer"
Re: Major problem running LUA-scripts
« Reply #1 on: September 08, 2010, 03:30:17 pm »
(In fact, the hub says, they are running, but still, the bots don't appear :( )
Not all scripts are stupid and create bot, most of them don't have any good reason to do that  ::)

Offline bastya_elvtars

  • Administrator
  • Forum God
  • *****
  • Posts: 3 795
  • Karma: +172/-7
  • The rock n' roll doctor
    • The LawMaker & FreshStuff3 Site
Re: Major problem running LUA-scripts
« Reply #2 on: September 08, 2010, 04:27:41 pm »
Agreed, bot creation almost always serves the purpose of sending PMs because many users have PMs blocked from users that are not online (i. e. in the userlist).

Offline Buhmann

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Major problem running LUA-scripts
« Reply #3 on: September 08, 2010, 10:43:34 pm »
Yeah well, but all scripts i tried use
Code: [Select]
frmHub:RegBot(bot.sBotName);and since the commands don't work, the script doesn't seem to be executed.

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 245
  • Karma: +206/-17
  • PtokaX "developer"
Re: Major problem running LUA-scripts
« Reply #4 on: September 08, 2010, 11:14:26 pm »
Oh, in that case script should show error message. Because that are old lua api script not working on PtokaX 0.4.1.2  ::)

Offline Buhmann

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Major problem running LUA-scripts
« Reply #5 on: September 08, 2010, 11:37:14 pm »
Old? The scripts I tried are all LUA 5.1. Is there still a newer version?

Just to be sure, can you recommend me any script that is definitely working on the current up-to-date version of ptokax? That way, we can tell if it's a scripting problem or a hub-problem :)

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: Major problem running LUA-scripts
« Reply #6 on: September 09, 2010, 01:58:11 am »
frmHub:RegBot is an API 1 hub call and thus won't work with latest Px builds.
For your reference and in hopes of avoiding this confusion all my scripts are
tagged API 2. Also nearly all of my scripts offer an option to set a bot and
if set will create a bot either registered [show in user list] or not. Registering
a bot [as bastya said] is only required to send pm's from the bot. By default
my scripts use the hub bot as set in the GUI. As such no bot is registered.

Lastly a quick way to tell one version of the API from another is to look for
certain functions. Main = API 1, OnStartup = API 2. These function are used
in most scripts and are equivalent relative to API versions.
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline Buhmann

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Major problem running LUA-scripts
« Reply #7 on: September 09, 2010, 03:55:11 pm »
hi again.
i tried your chathistory from http://board.ptokax.ch/index.php/topic,7335.0.html
and it's giving me some syntax errors:
1) comma after the last "end" (removed it)
2) last } seems to be surplus (removed it)
3) line 40: attempt to index global 'SetMan' (a nil value) (ok, i had to start the hub before trying to start the script)

still: the script is started, but i can't see anything working. chat history is not being sent to me after i log in.

like in all other scripts i tried, i can't use your commands

Code: [Select]
+delchat        Delete Single Chat Entry
+history        Get Chat History
+togglehistory  Toggle Chat History
+dayhistory      Chat History By Days
+chathelp        Chat History Help
+delete          Delete Chat History

what am i doing wrong  ???
« Last Edit: September 09, 2010, 04:01:00 pm by Buhmann »

Offline Buhmann

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Major problem running LUA-scripts
« Reply #8 on: September 09, 2010, 06:09:00 pm »
heya.
i got the chat history-script working. commands work fine.

however, i can only get the history by typing +history, but i don't get an automated PM or history list in main chat.

i followed your advice at http://board.ptokax.ch/index.php/topic,7335.msg70619.html#msg70619 to setup the login auto-history per main chat, not per PM, but it doesn't work.

Can you tell me what i might be doing wrong? ...again? :D

Offline Buhmann

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Major problem running LUA-scripts
« Reply #9 on: September 09, 2010, 06:58:02 pm »
update: everything is fine now. all problems solved :)
there was a syntax error in your post here: http://board.ptokax.ch/index.php/topic,7335.msg70619.html#msg70619

Code: [Select]
Core.SendToNick(user.sNick,"<"..Cfg.Bot.."> "..add..GetChat(Cfg.History))
should be

Code: [Select]
Core.SendToNick(user.sNick,"<"..Cfg.Bot.."> "..GetChat(Cfg.History))

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: Major problem running LUA-scripts
« Reply #10 on: September 10, 2010, 01:50:48 am »
There is no syntax error there.
Why don't you use the latest version [1.07]?
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline kammikaze

  • Junior Member
  • **
  • Posts: 18
  • Karma: +0/-0
Re: Major problem running LUA-scripts
« Reply #11 on: September 16, 2010, 10:12:03 am »
Hello, i have a problem with the scripts also, they work fine, all commands are working, but the scripts i added are not vissible for reg/vip and kvip, the only script that they can use is top ten. But the script guess game and helpdesk are not vissible for them while operators and higher have all the scripts i added to the hub. How can i set this. In the scripts i cannot find to set per profile(true/false) so thats why i think it must be in the hubsoft. Can anybody help me out?

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: Major problem running LUA-scripts
« Reply #12 on: September 16, 2010, 10:27:27 pm »
You need to be specific about which scripts and versions you're using.
Nearly all scripts by yours truly have profile settings. Sometimes at the
top of the script while other times in the command table. Given that you
mention non default profiles such as KVIP, you need to edit all profile
tables in script to match your custom profiles.
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

 

determinate determinate
guestbook