Creating chatrooms

Asked by ToniMontana

Hi poy,

i have a problem with this script:

Chatrooms v4.21 - LUA 5.1x [Strict][API 2] by jiten and Dessamator
http://board.ptokax.ch/index.php/topic,7498.0.html

The script gets loaded, RCMenu is available
but only 1 command is in the RCMenu (there should be 13 commands in RCMenu).
And when i try to create a chatroom then only a 'Hello' message from
hubbot gets send to me but the bot for the new created chatroom isnt registered on the hub.
Btw normaly the 'Hello' message gets send by the new created chatroom bot and not by the hubbot.

When i tried to create a vip chatroom i saw this in main chat:
<•HubBot•> $MyINFO $ALL -ViP- $ $$$0$

Used ADCH++ 2.5.0 mingw debug (348) and adchpp-ptokax-bridge rev40

Question information

Language:
English Edit question
Status:
Answered
For:
ADCH++-PtokaX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
ToniMontana (nformatoni) said :
#1

In DiXBoT the creating of chatrooms also dont work.
When DiXBoT start it wanna create a OPChat
but this dont work and i see this in mainchat:
<•HubBot•> $UserCommand 0 3
<•HubBot•> $UserCommand 0 3
<•HubBot•> $UserCommand 0 3
<•HubBot•> $UserCommand 0 3
* •HubBot• is enabled. RightClick on Hubtab or a User to access the Rightclick Commands.
<•HubBot•> $MyINFO $ALL [OpChat] $ $ $$$
<•HubBot•> $OpList [OpChat]$$
<•HubBot•> $MyINFO $ALL [OpChat] DiXBoT Default OpsChat$ $ $$$
<•HubBot•> $OpList [OpChat]$$
<•HubBot•> $MyINFO $ALL ViPCHAT $ $ $$$
<•HubBot•> $OpList ViPCHAT$$
<•HubBot•> $MyINFO $ALL •ViP• $ $ $$$
<•HubBot•> $OpList •ViP•$$

DiXBoT v2.1 Build 2987
http://dixbot.com/

Used ADCH++ 2.5.0 mingw debug (348) and adchpp-ptokax-bridge rev42

Revision history for this message
poy (poy) said :
#2

the Chatrooms script needed several changes, all done now in rev 43; should work fine. :)
i haven't tried DiXBoT yet, let me know if its chat rooms work too.

Revision history for this message
ToniMontana (nformatoni) said :
#3

I did a quick test with the chatrooms script and rev.43.
On first hubstart the hub crashed. Then i removed all other scripts
which should be loaded and started the hub again.
This time it didnt crash and the chatrooms.lua got loaded properly.
All RCMenu commands are available now and creating/deleting
chatrooms work too.
Also i found the reason for the hubcrash.
It seems that the ascii-talk script doesnt work with rev.43.
but it worked with previous versions from ptx-bridge
I have loaded 31 other scripts together with the chatrooms script
and the hub dont crash. As soon as the ascii-talk script is loaded
the hub crash.

Thx for making the chatrooms script work. :)

P.S.: Later i will give some feedback if DiXBoT script works with rev.43

Revision history for this message
ToniMontana (nformatoni) said :
#4

Have tested DiXBoT now.
- creating chatrooms work
- opchat on startup is created
- deleting a chatroom works

But adding a description to the chatroom doesnt work.
Also the opchat dont have a description.

I see this in main chat:
<•HubBot•> $MyINFO $ALL •ViP• Chat for ViP$ $ $$$
<•HubBot•> $MyINFO $ALL [OpChat] $ $ $$$
<•HubBot•> $MyINFO $ALL [OpChat] DiXBoT Default OpsChat$ $ $$$

Revision history for this message
ToniMontana (nformatoni) said :
#5

I did another test with the chatrooms script.
When i try to use the invite command to invite another user into a chatroom
then i get this error message:
2, 4: adchpp-ptokax.lua:1018: bad argument #1 to 'lower' (string expected, got nil)
stack traceback:
[C]: in function 'lower'
adchpp-ptokax.lua:1018: in function 'find_entity'
adchpp-ptokax.lua:318: in function 'SendToNick'
/adchpp/Scripts/chatrooms.lua:286: in function </adchpp/Scripts/chatrooms.lua:282>
[C]: in function 'gsub'
/adchpp/Scripts/chatrooms.lua:282: in function 'fFunction'
/adchpp/Scripts/chatrooms.lua:121: in function '?'
adchpp-ptokax.lua:92: in function 'execute_r'
adchpp-ptokax.lua:1602: in function 'parse_cmd'
adchpp-ptokax.lua:1693: in function <adchpp-ptokax.lua:1576>

Revision history for this message
poy (poy) said :
#6

the latter error on invite is a bug in the script, i just tried it on PtokaX and it produced the same error there too.

Revision history for this message
poy (poy) said :
#7

fixed bot update messages in rev 44.

Revision history for this message
poy (poy) said :
#8

the asciitalk script is not up-to-date with regards to path management; change its 52nd line from:

ATalk.Path = "ASCII/"

to:

ATalk.Path = Core.GetPtokaXPath() .. "ASCII/"

Revision history for this message
ToniMontana (nformatoni) said :
#9

The problem with Ascii-Talk is solved. Thx for this.
But when i use DiXBoT then i see this in mainchat everytime a user connects
<•HubBot•> $UserCommand 0 3
<•HubBot•> $UserCommand 0 3
<•HubBot•> $UserCommand 0 3
<•HubBot•> $UserCommand 0 3
* •HubBot• is enabled. RightClick on Hubtab or a User to access the Rightclick Commands.
<[ADCHPP]> •ViPChat• is now known as •ViPChat•
<[ADCHPP]> •ViPChat• is now known as •ViPChat•
<[ADCHPP]> [OpChat] is now known as [OpChat]
<[ADCHPP]> [OpChat] is now known as [OpChat]
<[ADCHPP]> [OpChat] is now known as [OpChat]

Revision history for this message
YouKnowWho (jorgosch) said :
#10

In the chatrooms.v4.21 script, what did you put in line 47?

If
 fChat = "tChatrooms.tbl",

the file is created in my syswow64 folder,
if
 fChat = "scripts/tChatrooms.tbl",

the script/hub doesn't start.

Revision history for this message
ToniMontana (nformatoni) said :
#11

YouKnowWho
to have the script and tbl file in the same folder
you need to change this:

 load = function(self)
  if not loadfile(tSettings.fChat) then
   local f = io.open(tSettings.fChat, "w+") f:write("return {\n"); f:write("}"); f:close()
  end
  self.items = dofile(tSettings.fChat)

to this:

 load = function(self)
  local Path = Core.GetPtokaXPath().."scripts/"
  if not loadfile(Path..tSettings.fChat) then
   local f = io.open(Path..tSettings.fChat, "w+") f:write("return {\n"); f:write("}"); f:close()
  end
  self.items = dofile(Path..tSettings.fChat)

Revision history for this message
YouKnowWho (jorgosch) said :
#12

Thank you, ToniMontana, much appreciated!

Revision history for this message
poy (poy) said :
#13

the "is now known as" messages should be fixed in rev 49 (not tested).

Revision history for this message
YouKnowWho (jorgosch) said :
#14

Do the chatrooms get saved for you guys? The hub crash when reloading scripts does seem to prevent it on my side.
Btw, poy: rv50 doesn't let the hub start.

Revision history for this message
poy (poy) said :
#15

got an error message?

Revision history for this message
YouKnowWho (jorgosch) said :
#16

No message, but I'm suspecting that one of the ptokax scripts that ran before now prevents the hub from starting up. Sorry for hijacking the thread.

Revision history for this message
ToniMontana (nformatoni) said :
#17

tested rev50 now. Hub starts properly.
"is now known as" is fixed
but now the OPChat from DiXBoT doesnt get registered anymore.

@YouKnowWho
Sorry was my fault. I forgot to give you the part for saving chatrooms.
Change this:
 save = function(self)
  Serialize = function(tTable, sTableName, hFile, sTab)
   sTab = sTab or "";
   hFile:write(sTab..sTableName.." {\n");
   for key, value in pairs(tTable) do
    if (type(value) ~= "function") then
     local sKey = (type(key) == "string") and string.format("[%q]", key) or string.format("[%d]", key);
     if(type(value) == "table") then
      Serialize(value, sKey.." =", hFile, sTab.."\t");
     else
      local sValue = (type(value) == "string") and string.format("%q", value) or tostring(value);
      hFile:write(sTab.."\t"..sKey.." = "..sValue);
     end
     hFile:write(",\n");
    end
   end
   hFile:write(sTab.."}");
  end
  local hFile = io.open(tSettings.fChat, "w+"); Serialize(self.items, "return", hFile); hFile:close()
 end

to this:
 save = function(self)
  local Path = Core.GetPtokaXPath().."scripts/"
  Serialize = function(tTable, sTableName, hFile, sTab)
   sTab = sTab or "";
   hFile:write(sTab..sTableName.." {\n");
   for key, value in pairs(tTable) do
    if (type(value) ~= "function") then
     local sKey = (type(key) == "string") and string.format("[%q]", key) or string.format("[%d]", key);
     if(type(value) == "table") then
      Serialize(value, sKey.." =", hFile, sTab.."\t");
     else
      local sValue = (type(value) == "string") and string.format("%q", value) or tostring(value);
      hFile:write(sTab.."\t"..sKey.." = "..sValue);
     end
     hFile:write(",\n");
    end
   end
   hFile:write(sTab.."}");
  end
  local hFile = io.open(Path..tSettings.fChat, "w+"); Serialize(self.items, "return", hFile); hFile:close()
 end

after changing this the chatrooms get saved again.

Revision history for this message
poy (poy) said :
#18

the recent path problems should be fixed in rev 51, please try (with unmodified scripts).

Revision history for this message
ToniMontana (nformatoni) said :
#19

Path problem is fixed in rev52
Problem with OpChat in DiXBoT is fixed in rev52 too.

Keep up the good work poy.

Revision history for this message
scsigirl (scsigirl) said :
#20

I have a different problem with the Chatrooms script running in the bridge. I'm using 4.1 and on every login, I see a handful of Chatroom CID error messages in the status bar for each user already logged into the hub. It makes the login process take much longer.

Also, where can I find the Chatrooms 4.4 script ?

Thank you for writing the adchpp-ptokax bridge, it's awesme!

Revision history for this message
poy (poy) said :
#21

thanks for the compliment.

the chatroom script i have been testing with is the one linked in the first post of this thread; it's working correctly as far as i can tell.

in any case, can you still post the chatroom script you have that is not working correctly with ADCH++-PtokaX?

Can you help with this problem?

Provide an answer of your own, or ask ToniMontana for more information if necessary.

To post a message you must log in.