设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1727|回复: 4
打印 上一主题 下一主题

[已经过期] 请问这个网络脚本怎么用?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
66 小时
注册时间
2014-4-15
帖子
18
跳转到指定楼层
1
发表于 2015-7-9 18:37:32 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
RUBY 代码复制
  1. #==============================================================================
  2. # Window Chat
  3. #==============================================================================
  4. class Window_Chat < Window_Base
  5.  
  6.   def initialize
  7.     super(285, (Graphics.height-(WLH*4+32)-WLH), 250, (WLH*4+32))
  8.     @scroll_bar = ScrollBar.new(self)
  9.     $windows << self
  10.     @size = 0
  11.     create_buttons
  12.   end
  13.  
  14.   def create_buttons
  15.     @guild_button = Button.new(self, 2, -WLH+4, "公会") { talk(0); @textbox.text = ""; @textbox.text += "@"; @textbox.active = true ;$聊天[$聊天宽度,0]="@";$聊天宽度 += 1;}
  16.     @guild_button.tip_text = ["公会聊天(绿色)"]
  17.     @friends_button = Button.new(self, @guild_button.x+@guild_button.width+2, -WLH+4, "好友") { talk(1); @textbox.text = ""; @textbox.text += "#"; @textbox.active = true ;$聊天[$聊天宽度,0]="#";$聊天宽度 += 1;}
  18.     @friends_button.tip_text = ["好友聊天(蓝色)"]
  19.     @whisper_button = Button.new(self, @friends_button.x+@friends_button.width+2, -WLH+4, "私聊") { talk(2); @textbox.text = ""; @textbox.text += "/#{$game_temp.last_whisper} "; @textbox.active = true;$聊天[$聊天宽度,0]="/";$聊天宽度 += 1; }
  20.     @whisper_button.tip_text = ["私聊聊天(蓝色)"]
  21.     @all_button = Button.new(self, @whisper_button.x+@whisper_button.width+2, -WLH+4, "世界") { talk(3); @textbox.text = ""; @textbox.text += "!"; @textbox.active = true ;$聊天[$聊天宽度,0]="!";$聊天宽度 += 1;}
  22.     @all_button.tip_text = ["世界聊天(粉红色)"]
  23.     @normal_button = Button.new(self, @all_button.x+@all_button.width+2, -WLH+4, "正常") { talk(4); @textbox.text = ""; @textbox.active = true}
  24.     @normal_button.tip_text = ["正常聊天"]
  25.     @textbox = TextBox.new(self, 2, self.height, self.width-55, 25) { write }
  26.     Button.new(self, @textbox.width+4, self.height, "发送") { write }
  27.   end
  28.  
  29.   def update
  30.     super
  31.     #--------------------------------------------------------------------------
  32.     $Ltf.active = self.active
  33.     @textbox.text = $聊天
  34.     # 输入窗口刷新
  35.     $Ltf.update
  36.     #--------------------------------------------------------------------------
  37.  
  38.     refresh if @size != $game_temp.chat_text.size
  39.   end
  40.  
  41.   def refresh
  42.     @textbox.active = self.active
  43.     self.contents.clear
  44.     scroll_down
  45.     y = 0
  46.     for text in $game_temp.chat_text
  47.       if text[0] =~ /<Admin>/
  48.         self.contents.font.color = Color.admin
  49.       elsif text[0] =~ /<GM>/
  50.         self.contents.font.color = Color.gm
  51.       elsif text[0] =~ /@(.*)/
  52.         next if @friend_talk or @whisper_talk or @all_talk
  53.         next unless $1.to_i == $actor.guild
  54.         self.contents.font.color = Color.guild
  55.       elsif text[0] =~ /#(.*)/
  56.         next if @guild_talk or @whisper_talk or @all_talk
  57.         next unless Network.friends.include?($1) or $actor.name == $1
  58.         self.contents.font.color = Color.friend
  59.       elsif text[0] =~ /\/(.*) (.*)/
  60.         next if @guild_talk or @friend_talk or @all_talk
  61.         next unless $1 == $actor.name or $2 == $actor.name
  62.         $game_temp.last_whisper = $1
  63.         self.contents.font.color = Color.whisper
  64.       elsif text[0] =~ /!/
  65.         next if @guild_talk or @friend_talk or @whisper_talk
  66.         self.contents.font.color = Color.all
  67.       else
  68.         self.contents.font.color = normal_color
  69.       end
  70.       self.contents.draw_text(0, y, contents.width, WLH, text[1])
  71.       y += WLH
  72.     end
  73.     @size = $game_temp.chat_text.size
  74.   end
  75.  
  76.   def talk(x)
  77.     @guild_talk = (x == 0)
  78.     @friend_talk = (x == 1)
  79.     @whisper_talk = (x == 2)
  80.     @all_talk = (x == 3)
  81.     refresh
  82.   end
  83.  
  84.   def write
  85.     return if @textbox.text.to_s.nil? or @textbox.text.to_s == ""
  86.     for i in Network.chat_filter
  87.       loop do
  88.         @textbox.text.gsub!(/#{i}/i, "")
  89.         break if @textbox.text.casecmp(i) != 0
  90.       end
  91.     end
  92.     mesage_commands
  93.     message_balloon
  94.     return if @textbox.text.nil? or @textbox.text == ""
  95.     text = @textbox.text.delete(@textbox.text[0,1]).to_s
  96.     if @textbox.text[0,1] == "@" and $actor.guild > 0
  97.       Network.send_chat("@#{$actor.guild}", "#{$actor.name}: #{text}", 1)
  98.     elsif @textbox.text[0,1] == "#"
  99.       Network.send_chat("##{$actor.name}", "#{$actor.name}: #{text}", 1)
  100.     elsif @textbox.text[0,1] == "/"
  101.       t = @textbox.text.split(" ")
  102.       Network.send_chat("#{t[0]} #{$actor.name}", "#{$actor.name}: #{t[1]}", 1)
  103.     elsif @textbox.text[0,1] == "!"
  104.       Network.send_chat("!", "#{$actor.name}: #{text}", 1)
  105.     elsif Network.hierarchy == 2
  106.       Network.send_chat("<Admin>", "#{$actor.name}: #{@textbox.text.to_s}")
  107.     elsif Network.hierarchy == 1
  108.       Network.send_chat("<GM>", "#{$actor.name}: #{@textbox.text.to_s}")
  109.     else
  110.       Network.send_chat("", "#{$actor.name}: #{@textbox.text.to_s}")
  111.     end
  112.     @textbox.text = ""
  113.     $聊天= ""
  114.   end
  115.  
  116.   def mesage_commands
  117.     return if Network.hierarchy <= 0
  118.     if @textbox.text.include?("/kick")
  119.       data = @textbox.text.split(' ')
  120.       unless data[1].nil? or data[1] == ""
  121.         Network.gm_commands(0, data[1].to_s)
  122.       end
  123.       @textbox.text = ""
  124.       $聊天= ""
  125.     end
  126.     if @textbox.text.include?("/suspend")
  127.       data = @textbox.text.split(' ')
  128.       unless data[1].nil? or data[1] == ""
  129.         Network.gm_commands(1, data[1].to_s)
  130.       end
  131.       @textbox.text = ""
  132.       $聊天= ""
  133.     end
  134.     if @textbox.text.include?("/ban")
  135.       data = @textbox.text.split(' ')
  136.       unless data[1].nil? or data[1] == ""
  137.         Network.gm_commands(2, data[1].to_s)
  138.       end
  139.       @textbox.text = ""
  140.       $聊天= ""
  141.     end
  142.   end
  143.  
  144.   def message_balloon
  145.     return if @textbox.text[0,1] == "@"
  146.     return if @textbox.text[0,1] == "!"
  147.     return if @textbox.text[0,1] == "#"
  148.     return if @textbox.text[0,1] == "/"
  149.     $game_player.message1 = @textbox.text[0, 13].to_s
  150.     $game_player.message2 = @textbox.text[13, 99].to_s
  151.     $game_player.message_duration = 240
  152.     Network.socket.send("<update>@message1 = '#{$game_player.message1}';@message2 = '#{$game_player.message2}'</update>\n")
  153.   end
  154.  
  155.   def scroll_down
  156.     if $game_temp.chat_text.size >= 15
  157.       $game_temp.chat_text -= $game_temp.chat_text.values_at(0...14)
  158.       self.oy = 0
  159.       create_contents
  160.     end
  161.     if self.contents.height < ($game_temp.chat_text.size*WLH)
  162.       self.oy += (($game_temp.chat_text.size*WLH) - self.contents.height)
  163.       self.contents.dispose
  164.       self.contents = Bitmap.new(self.width-32, ($game_temp.chat_text.size*WLH))
  165.     end
  166.   end
  167.  
  168. end
头像被屏蔽

Lv1.梦旅人 (禁止访问)

梦石
0
星屑
88
在线时间
631 小时
注册时间
2014-8-4
帖子
3600
2
发表于 2015-7-10 16:14:30 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
66 小时
注册时间
2014-4-15
帖子
18
3
 楼主| 发表于 2015-7-12 16:15:54 | 只看该作者
只是想问一下这里的管理命令怎么用,准备搭个服务器和朋友玩。是有一整套脚本的,但还是谢谢啦。

点评

有一整套脚本而没有说明吗…… 如果是购买的应该有后续服务支持才对。  发表于 2015-7-13 18:01
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
66 小时
注册时间
2014-4-15
帖子
18
4
 楼主| 发表于 2015-7-14 12:29:42 | 只看该作者
1760206308 发表于 2015-7-12 16:15
只是想问一下这里的管理命令怎么用,准备搭个服务器和朋友玩。是有一整套脚本的,但还是谢谢啦。 ...

只是在网上下的,并没有什么后续服务,也没有花钱。

点评

为何不贴上来网站?  发表于 2015-7-14 12:54
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
66 小时
注册时间
2014-4-15
帖子
18
5
 楼主| 发表于 2016-3-17 19:02:47 | 只看该作者
很久之前下的,后来忘了。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-30 20:32

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表