Chat

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Chat as PDF for free.

More details

  • Words: 642
  • Pages: 5
este script sirve para juegos online, usa f5 para chatear y esc para poder caminar

first go to game_temp* and add: attr_accessor :chat and in def initialize @chat = false then add this above main: code class scene_map alias netplay_main main alias netplay_update update def main @input_window = window_chatinput.new @chat_window = window_chat.new netplay_main @input_window.dispose @chat_window.dispose end def update @input_window.update @chat_window.update $network.update if input.trigger?(input::f5) $game_temp.chat = true $scene = scene_chat.new end netplay_update end end then go to scene_chat, and add: $game_temp.chat = false underneath input.getkey it'll look like this: code if input.getkey(27) $game_temp.chat = false $scene = scene_map.new end and last, overwrite these with window_chat and chatinput window_chat code #============================================================================== # �� window_chat #-----------------------------------------------------------------------------# �@displays chat messages. #==============================================================================

class window_chat < window_base #-------------------------------------------------------------------------# �� initializes chat window. #-------------------------------------------------------------------------def initialize super(0, 480-132, 640, 132) self.contents = bitmap.new(width - 32, height - 32) self.contents.font.size = 16 self.opacity = 160 refresh end #-------------------------------------------------------------------------# �� refreshes chat window. #-------------------------------------------------------------------------def refresh $game_temp.chat_log.delete_at(0) while $game_temp.chat_log.size > 5 self.contents.clear for i in 0..$game_temp.chat_log.size - 1 self.contents.draw_text(0, i * 16 - 8, 640, 32, $game_temp.chat_log[i]) end $game_temp.chat_refresh = false end #-------------------------------------------------------------------------# �� updates chat window. #-------------------------------------------------------------------------def update refresh if $game_temp.chat_refresh super end end and window_chatinput code #============================================================================== # �� window_chatinput originally created by: cybersam #-----------------------------------------------------------------------------# �@based on the full-keyboard input script created by cybersam. #============================================================================== class window_chatinput < window_base #-------------------------------------------------------------------------# �� initializes chat input window. #-------------------------------------------------------------------------def initialize super(0, 480-48, 640, 48) self.contents = bitmap.new(width - 32, height - 32) self.contents.font.size = 16 self.opacity = 0 @text = [] refresh end #--------------------------------------------------------------------------

# �� refreshes chat input window. #-------------------------------------------------------------------------def refresh @log = @text.to_s self.contents.clear self.contents.draw_text(0, -16, 620, 48, @text.to_s + "_") end #-------------------------------------------------------------------------# �� refreshes chat input window. #-------------------------------------------------------------------------def add(char) if @text.size >= 80 $game_system.se_play($data_system.buzzer_se) else @text.push(char.to_s) refresh end end #-------------------------------------------------------------------------# �� updates input chat window. #-------------------------------------------------------------------------def update if $game_temp.chat == true # sends chat message. if input.getkey(13) if @text.size == 0 $game_system.se_play($data_system.buzzer_se) else $network.socket.send("chat:<#{$game_party.actors[0].name}) #{@text.to_s}>\r\n") @text.clear refresh end end # removes last entry in test. if input.getkey(8) if @text.size == 0 $game_system.se_play($data_system.buzzer_se) else @text.delete_at(-1) refresh end end # adds a pressed key. if input.getstate(16) add("a") if input.getkey(65) add("b") if input.getkey(66) add("c") if input.getkey(67) add("d") if input.getkey(68) add("e") if input.getkey(69) add("f") if input.getkey(70) add("g") if input.getkey(71) add("h") if input.getkey(72) add("i") if input.getkey(73) add("j") if input.getkey(74) add("k") if input.getkey(75) add("l") if input.getkey(76)

add("m") if input.getkey(77) add("n") if input.getkey(78) add("o") if input.getkey(79) add("p") if input.getkey(80) add("q") if input.getkey(81) add("r") if input.getkey(82) add("s") if input.getkey(83) add("t") if input.getkey(84) add("u") if input.getkey(85) add("v") if input.getkey(86) add("w") if input.getkey(87) add("x") if input.getkey(88) add("y") if input.getkey(89) add("z") if input.getkey(90) add(")") if input.getkey(48) add("!") if input.getkey(49) add("@") if input.getkey(50) add("#") if input.getkey(51) add("$") if input.getkey(52) add("%") if input.getkey(53) add("^") if input.getkey(54) add("&") if input.getkey(55) add("*") if input.getkey(56) add("(") if input.getkey(57) add(":") if input.getkey(186) add("+") if input.getkey(187) add("<") if input.getkey(188) add("_") if input.getkey(189) add(">") if input.getkey(190) add("?") if input.getkey(191) add("{") if input.getkey(219) add("|") if input.getkey(220) add("}") if input.getkey(221) add("\"") if input.getkey(222) else add("a") if input.getkey(65) add("b") if input.getkey(66) add("c") if input.getkey(67) add("d") if input.getkey(68) add("e") if input.getkey(69) add("f") if input.getkey(70) add("g") if input.getkey(71) add("h") if input.getkey(72) add("i") if input.getkey(73) add("j") if input.getkey(74) add("k") if input.getkey(75) add("l") if input.getkey(76) add("m") if input.getkey(77) add("n") if input.getkey(78) add("o") if input.getkey(79) add("p") if input.getkey(80) add("q") if input.getkey(81) add("r") if input.getkey(82) add("s") if input.getkey(83) add("t") if input.getkey(84) add("u") if input.getkey(85) add("v") if input.getkey(86) add("w") if input.getkey(87)

add("x") if input.getkey(88) add("y") if input.getkey(89) add("z") if input.getkey(90) add("0") if input.getkey(48) add("1") if input.getkey(49) add("2") if input.getkey(50) add("3") if input.getkey(51) add("4") if input.getkey(52) add("5") if input.getkey(53) add("6") if input.getkey(54) add("7") if input.getkey(55) add("8") if input.getkey(56) add("9") if input.getkey(57) add(";") if input.getkey(186) add("=") if input.getkey(187) add(",") if input.getkey(188) add("-") if input.getkey(189) add(".") if input.getkey(190) add("/") if input.getkey(191) add("[") if input.getkey(219) add("\\") if input.getkey(220) add("]") if input.getkey(221) add("'") if input.getkey(222) end add(" ") if input.getkey(32) add("*") if input.getkey(106) add("+") if input.getkey(107) add("-") if input.getkey(109) add("/") if input.getkey(111) end end end

Related Documents

Chat
May 2020 24
Chat
May 2020 20
Chat
November 2019 43
Chat
November 2019 29
Chat
October 2019 31
Chat
November 2019 32