Jump to content




Chatbox


12 replies to this topic

#1 DusterTheFirst

  • Members
  • 40 posts

Posted 08 May 2015 - 10:34 PM

i need help with chatboxes

so i have a program and the lines say


local cb = peripheral.wrap('chatbox_3')

function write(text,size,pos1,pos2,wait)

cb.say(text, 100000, true, "store")

end

and it returns nothing in the chat

anyone know what to do

also the extra variables are going to be used later

#2 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 09 May 2015 - 12:20 AM

local cb = peripheral.wrap('chatbox_3')

function write(text,size,pos1,pos2,wait)
  cb.say(text, 100000, true, "store")
end

[code][/code] tags help a lot when posting code.

What you have posted will never do anything, because you never call the function.

#3 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 09 May 2015 - 07:43 AM

Which chatbox are you using, exactly?

#4 DusterTheFirst

  • Members
  • 40 posts

Posted 09 May 2015 - 09:07 AM

sorry I forgot to add the last part

write("CODEING",5,1,1,10)

i am useing peripherals++

Edited by DusterTheFirst, 09 May 2015 - 09:34 AM.


#5 Square789

  • Members
  • 39 posts
  • LocationUniverse:C:/MilkyWay/Sol/Earth/Europe/Germany

Posted 09 May 2015 - 09:16 AM

You also called your function write(), which will lead to an error or something because there is already a function called write().
write() does the same as print(), except it doesn't return "\n" (new line) at the end

Edited by Square789, 09 May 2015 - 09:17 AM.


#6 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 09 May 2015 - 09:27 AM

So this thing, then. Your call looks about right.

That said, putting aside what Square mentioned about overriding write (he's right, it's a bad idea), where did you define the CODEING variable? Or did you mean to wrap that in quotes, to treat it as a string?

#7 DusterTheFirst

  • Members
  • 40 posts

Posted 09 May 2015 - 09:33 AM

oh it is a "" thing sorry

#8 DusterTheFirst

  • Members
  • 40 posts

Posted 09 May 2015 - 09:55 AM

also how do you enable lables for chatboxes in config

#9 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 09 May 2015 - 10:40 AM

In your MineCraft folder, there'll be a config folder - odds are there'll be a file named after Peripherals++ in there. Open that in a text editor and see what jumps out at you.

#10 DusterTheFirst

  • Members
  • 40 posts

Posted 09 May 2015 - 11:44 AM

how do i name it without changeing distances of the chatbox

#11 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 09 May 2015 - 12:12 PM

Beats me if it's even possible, but you could try passing nil or 0 as the distance.

#12 popdog15

  • Members
  • 82 posts

Posted 10 May 2015 - 07:05 AM

There is a limit to the distance within the config last I checked.

#13 DusterTheFirst

  • Members
  • 40 posts

Posted 10 May 2015 - 09:45 AM

thanks





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users