Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - iNumPad

1
Script Requests / Re: Simple MySQL script
June 11, 2013, 01:04:57 pm
Quote from: Blizzard on June 11, 2013, 11:09:15 am
If you want to access the SQL database directly, you need to use some program for that. That's what I refer to as SQL Management Software, basically the same program you used to create the database. You should have an option somewhere called "SQL query". This is what you are looking for.

SQL query is this, right?:
-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tempo de Geração: 24/03/2012 às 23h13min
-- Versão do Servidor: 5.5.16
-- Versão do PHP: 5.3.8

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "-02:00";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Estrutura da tabela `recordes`
--

CREATE TABLE IF NOT EXISTS `recordes` (
  `Nick` varchar(255) NOT NULL COMMENT 'Nick do utilizador',
  `Pontos` int(20) NOT NULL DEFAULT '0' COMMENT 'Pontuação',
  `Hora` int(11) NOT NULL DEFAULT '0' COMMENT 'Hora do envio'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


But, i don't want to create tables, i want to read values of the tables in RPG Maker XP.

Look this script from one guy from Brazil:
#==============================================================================#
# Gab MySQL Highscores                                                         #
# Autor: Gab!                                                                  #
# Data:  24/03/12                                                              #
#------------------------------------------------------------------------------#
# Script que permite ao usuário enviar sua pontuação para uma database online  #
# e ver, também, a pontuação de outros jogadores.                              #
#                                                                              #
# - Requerimentos:                                                             #
#   * libmysql.dll                                                             #
#   * Uma database online                                                      #
#                                                                              #
# - Aviso:                                                                     #
#   Os dados não são protegidos, logo, se alguém desencriptar seu jogo, terá   #
#   acesso ao seu servidor, usuário e senha. O autor não se responsabiliza por #
#   perda de informações e/ou quaisquer danos.                                 #
#                                                                              #
# - Como usar:                                                                 #
#   Para enviar uma pontuação, chame o script:                                 #
#                                                                              #
#   Highscores.send(a,b)                                                       #
#   a = Nick (entre aspas). Exemplo: "Nick".                                   #
#   b = Pontuação.          Exemplo: 200                                       #
#                                                                              #
#   Para enviar a pontuação a partir de variáveis, chame:                      #
#                                                                              #
#   Highscores.send_variables(a,b)                                             #
#   a = ID de um herói (da database). O nome será enviado. Exemplo: 1          #
#   b = ID de uma variável, que corresponde a pontuação.   Exemplo: 2          #
#==============================================================================#

module Gab
  # CONFIGURAÇÕES DA DATABASE
  module Mysql
    Host = "localhost"     # Servidor MySQL (local : 127.0.0.1)
    Port = 3306            # Porta (padrão: 3306)
   
    User = "root"          # Usuário
    Pass = ""              # Senha
   
    Base = "GabHighscores" # Nome da database
    Tabl = "recordes"      # Nome da tabela
   
    # Erros
    Err_Con = "Mysql:\nNão foi possível conectar à database"
    Err_Req = "Mysql:\nNão foi possível enviar o pedido à database"
  end
 
  # CONFIGURAÇÕES DA SCENE
  module SceneHighscores
    Back = "HighscoresBG"      # Imagem de fundo
   
    # Janela de título
    Title = {
      :x  =>              5, # Posição x
      :y  =>              0, # Posição y
      :w  =>            300, # Largura
      :h  =>             64, # Altura
      :fn => "Trebuchet MS", # Nome da fonte
      :fs =>             30, # Tamanho da fonte
      :fc =>      "#00CCFF", # Cor da fonte em hexadecimal
      :tx =>     "Recordes", # Texto na janela
      :al =>              1, # Alinhamento do texto
                             # (0 = Esquerda | 1 = Centro | 2 = Direita)
    }
   
    # Janela de recordes
    Recorde = {
      :x   =>              5, # Posição x
      :y   =>             64, # Posição y
      :w   =>            300, # Largura
      :h   =>            352, # Altura
     
      :fn1 => "Trebuchet MS", # Nome da fonte dos nomes
      :fs1 =>             25, # Tamanho da fonte dos nomes
      :fc1 =>      "#00CCFF", # Cor da fonte dos nomes em hexadecimal
     
      :rnx =>              0, # Posição relativa x dos nomes
      :rny =>              0, # Posição relativa y dos nomes
     
      :fn2 => "Trebuchet MS", # Nome da fonte dos pontos
      :fs2 =>             17, # Tamanho da fonte dos pontos
      :fc2 =>      "#CCFF00", # Cor da fonte dos pontos em hexadecimal
     
      :rpx =>              5, # Posição relativa x dos pontos
      :rpy =>             25, # Posição relativa y dos pontos
     
      :fn3 => "Trebuchet MS", # Nome da fonte da data
      :fs3 =>             17, # Tamanho da fonte da data
      :fc3 =>      "#CCFF00", # Cor da fonte da data em hexadecimal
     
      :rdx =>              5, # Posição relativa x da data
      :rdy =>             37, # Posição relativa y da data
     
      :max =>             20, # Máximo de recordes exibidos
      :pdd =>              5, # Espaço vertical entre os recordes
     
      # Formato de hora
      :tfm => "%d/%m/%y às %H:%M:%S",
      # Ocorrem as seguintes substituições:
      # %d -> Dia
      # %m -> Mês
      # %y -> Ano
      # %I -> Hora (1~12)
      # %H -> Hora (0~24)
      # %M -> Minuto
      # %S -> Segundos
      # %P -> Indicador de meridiano (AM/PM)
      # %p -> Indicador de meridiano (am/pm)
      # %% -> "%" literal
     
     
      :bar1 =>      "#FFFFFF", # Cor de fundo da barra de rolagem
      :bar2 =>      "#00DD00", # Cor da barra de rolagem
    }
   
  end
end

#===============================================================================
# Não modificar a partir daqui
#===============================================================================

# COMPATIBILIDADE - RMXP
if defined?(RPG::Cache)
  class Scene_Base
    def main
      start                   
      Graphics.transition(10)
      Input.update             
      loop do
        update                 
        break if $scene != self
      end
      Graphics.update
      Graphics.freeze   
      terminate         
    end 
   
    def update
      Graphics.update
      Input.update
    end
  end
 
  class Bitmap
    def clear_rect(x, y, w, h)
      fill_rect(x,y,w,h,BLANK)
    end
    BLANK = Color.new(0,0,0,0)
  end
 
  Cache = RPG::Cache
end

class Numeric
  def copymem(len)
    buf = 0.chr * len
    Win32API.new("kernel32", "RtlMoveMemory", "pll", "").call(buf, self, len)
    return buf
  end
end

class Mysql
  include Gab::Mysql
  DLL     = "libmysql.dll" 
 
  MI   = Win32API.new(DLL, "mysql_init",               "l",        "l")
  MQ   = Win32API.new(DLL, "mysql_query",              "lp",       "l")
  MFR  = Win32API.new(DLL, "mysql_fetch_row",          "p",        "l")
  MFL  = Win32API.new(DLL, "mysql_fetch_lengths",      "p",        "l")
  MNF  = Win32API.new(DLL, "mysql_num_fields",         "p",        "l")
  MSR  = Win32API.new(DLL, "mysql_store_result",       "l",        "l")
  MRC  = Win32API.new(DLL, "mysql_real_connect",       "lpppplpl", "l")
  MNR  = Win32API.new(DLL, "mysql_num_rows",           "p",        "l")
  MFRE = Win32API.new(DLL, "mysql_free_result",        "p",        "l")
 
  def initialize(h, u, p, b, po)
    @handle = MI.call(0)
    alert(Err_Con) if MRC.call(@handle, h, u, p, b, po, nil, 0) == 0
  end

  def query(req, ret = true)
    return alert(Err_Req + req) unless MQ.call(@handle,req)
   
    MFRE.call(@result) if @result
    @result = MSR.call(@handle)
   
    return @result unless ret
   
    r = @result
    nr, nf, en = MNR.call(r), MNF.call(r), []
   
    nr.times{|i|
      c  = MFR.call(r).copymem(4).unpack("i").first
      tf = MFL.call(r).copymem(4*nf).unpack("i*")
      sf = tf.inject(0){|n,i| n + i}
      en << c.copymem(sf + nf).split("\0")
    }
   
    return en
  end
 
  if RUBY_VERSION =~ /1\.9/
    alias alert msgbox
  else
    alias alert print
  end
 
  private :alert
 
end

module Highscores
  INST = Mysql.new(Gab::Mysql::Host, Gab::Mysql::User, Gab::Mysql::Pass, Gab::Mysql::Base, Gab::Mysql::Port)
 
  module_function
  def send(nome, pontos)
    INST.query("INSERT INTO `#{Gab::Mysql::Tabl}` (Nick, Pontos, Hora) VALUES ('#{nome}', #{pontos}, #{Time.now.to_i})", false)
  end
 
  def send_variables(id1, id2)
    send($game_actors[id1].name, $game_variables[id2])
  end
 
  def get(max = 10)
    INST.query("SELECT * FROM `#{Gab::Mysql::Tabl}` ORDER BY Pontos DESC")[0, max]
  end
 
  def scene
    SceneManager.call(Scene_Highscores)
  end
end

class Window_Title < Window_Base
  include Gab::SceneHighscores
 
  def initialize
    super(Title[:x], Title[:y], Title[:w], Title[:h])
    self.contents = Bitmap.new(self.width - 32, self.height - 32)
   
    hex = Title[:fc].delete("#").scan(/../).map{|i| i.to_i(16)}[0,4].compact
   
    self.contents.font.name  = Title[:fn]
    self.contents.font.size  = Title[:fs]
    self.contents.font.color = Color.new(*hex)
   
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.draw_text(self.contents.rect, Title[:tx], Title[:al])
  end
end

class Window_Highscores < Window_Base
  include Gab::SceneHighscores
 
  def initialize
    super(Recorde[:x], Recorde[:y], Recorde[:w], Recorde[:h])
   
    @color = [:fc1, :fc2, :fc3, :bar1, :bar2].map{|i|
      h = Recorde[i].delete("#").scan(/../).map{|i| i.to_i(16)}[0,4].compact
      Color.new(*h)
    }
   
    @total = Recorde[:rny] + Recorde[:rpy] + Recorde[:rdy] + Recorde[:pdd]
    @gets = Highscores.get(Recorde[:max])
   
    self.contents.dispose if self.contents
    self.contents = Bitmap.new(self.width - 32, @total * @gets.size - Recorde[:pdd] * 2)
   
    refresh
    refresh_bar if contents.height > self.height - 32
  end
 
  def refresh
    self.contents.clear
   
    w, h = contents.width, contents.font.size
   
    self.contents.font.name  = Recorde[:fn1]
    self.contents.font.size  = Recorde[:fs1]
    self.contents.font.color = @color[0]
    @gets.each_with_index{|(nick, points, date), index|
      self.contents.draw_text(Recorde[:rnx], @total * index + Recorde[:rny], w, h, nick)
    }
   
    self.contents.font.name  = Recorde[:fn2]
    self.contents.font.size  = Recorde[:fs2]
    self.contents.font.color = @color[1]
    @gets.each_with_index{|(nick, points, date), index|
      self.contents.draw_text(Recorde[:rpx], @total * index + Recorde[:rpy], w, h, points)
    }
   
    self.contents.font.name  = Recorde[:fn3]
    self.contents.font.size  = Recorde[:fs3]
    self.contents.font.color = @color[2]
    @gets.each_with_index{|(nick, points, date), index|
      date = Time.at(date.to_i).strftime(Recorde[:tfm])
      self.contents.draw_text(Recorde[:rpx], @total * index + Recorde[:rdy], w, h, date)
    }
   
  end

  def refresh_bar
    self.contents.clear_rect(contents.width - 2, 0, 2, contents.height)
    self.contents.fill_rect(contents.width - 2, self.oy, 2, self.height - 32, @color[3])
    h = ((self.height - 32) ** 2) / contents.height
    y = ((h + 1) * self.oy / (self.height - 32))
    self.contents.fill_rect(contents.width - 2, self.oy + y, 2, h, @color[4])
  end
 
  def update
    super()
    if Input.press?(Input::DOWN)
      self.oy += 1 if (contents.height - self.oy > self.height - 32)
      refresh_bar
    elsif Input.press?(Input::UP) && self.oy != 0
      self.oy -= 1
      refresh_bar
    end
  end

end

class Scene_Highscores < Scene_Base
  def start
    @title = Window_Title.new
    @high  = Window_Highscores.new
    @back  = Sprite.new
    @back.bitmap = Cache.picture(Gab::SceneHighscores::Back)
  end
 
  def update
    super()
    @title.update
    @high.update
    return_scene if Input.trigger?(Input::B)
  end
 
  def terminate
    Graphics.freeze
    @title.dispose
    @high.dispose
    @back.bitmap.dispose
    @back.dispose
  end
end


# COMPATIBILIDADE - RMVX / RMXP
if RUBY_VERSION !~ /1\.9/
  class Scene_Highscores
    def initialize(ret = nil)
      super()
      @return = ret.class
    end
   
    def return_scene
      $scene = @return.new
    end
  end
 
  class << Highscores
    undef scene
    def scene
      $scene = Scene_Highscores.new($scene)
    end
  end
end

Need a dll to run: http://www.mediafire.com/?0hv1ex2v4u1jtcz
(And need to run the Query that i post before in you Database.)

This script send the points and the nick of one player to the database, and if i play the game in other computer will appear in the window the points and nick of the player that finish some minigame.

This script Works so fine to me, but i don't understand some way to give a value of the table toany variable.
Example: $string1 = value from the table Version in the  Test database


(Off: I need some feedback about the English. Tnx)
2
Script Requests / Re: Simple MySQL script
June 11, 2013, 10:44:54 am
Quote from: gameus on June 11, 2013, 02:21:39 am
He's asking for an SQL script that doesn't involve using RMX-OS.


Yep, you are right!


@Blizzard: No, is not this. Can you make a simple script of sql, that not envolve some ruby file to execute. Just a script... (Ahh, and i think that mysqllib..dll is need, right?)
3
Script Requests / Simple MySQL script
June 10, 2013, 07:02:39 pm
Hi, sorry about my English...

Hey guys, i need a script that make a simple SQL conection with one database, that gets values from tables, and can send new values too.

I knew thtat RMX-OS use this type of 'conection'. But i never can put this to work.. Anyway, i need this not for mmo system, i need just to check the last version of game for exemple.. Or to one online serial system.. and more possibilities that this script will give to me, if someone can make that.

Tnx.
4
Welcome! / Hi...
February 07, 2013, 03:43:59 am
Hi, to people that know me, i'm called NumPad, and to people that not know me, i'm called NumPad too.
I met RPG Maker much years ago, but i just 'played/haved fun' with it. But 2 years ago, i went search for help, and i found much forums...
I'm a geral maker. My most  bad area is Mapping, and the best area is Scripting. (No, i not a scripter.. but i try ;P)

I'm from Brazil, and have 15 years old.

I love pirates. The Big Bang Theory, The Walking Dead and C.S.I.

I like to hear metal songs. And a little bit of Punk Rock.

I love animes, and all Japanese culture.

I hate my country.

And i will try to grow in americans forums. ;P
- Peace and Boredom to everyone.
5
Event System Database / Re: [XP] Bridge System
February 07, 2013, 03:25:28 am
Quote from: Blizzard on February 07, 2013, 03:13:51 am
You should recheck the template topic, I think something is missing in your post: http://forum.chaos-project.com/index.php/topic,1429.0.html

Edited, sir. ;P
6
Event System Database / [XP] Bridge System
February 07, 2013, 02:25:35 am
Bridge System
Version: 1.0
Type: Environment Mod



Introduction
Observation: ShowHide
Hi, this is my first topic. Please say if i do something wrong here. And please tell me if i messed up in English, because English is not my native language. q;


The bridge system allows the character move "up", as the "bottom" of a bridge. Very useful for traditional RPG style games.


Features


  • Use just one Switch;

  • 100% compatible with all;

  • Very easy to use;




Screenshot

Under the bridge: ShowHide



Demo

@MediaFire


Instructions

No need. ;p


Credits


  • alenoomaker ~ For making it




Author's Notes

Use! And give credits. For Comercial & Non-Comercial games
7
First, sorry 'bout my English. I'm Brazilian.
Second, stupid question: This is a USA Forum or UK Forum?

Let's go to topic!


This is a new year, and it would be nice to have a new layout/look.

The version of SMF is so outdated. The current version is 2.0.3. (But, the best is 2.0.2[because the support and modifications])

With a new version, brings up new features to Chaos Project.

Other suggestion is to change the system to IP Board. But this need to purchased. =/

Would be nice if it had YouTube Embbed, SoundCloud embbed, news/more 'social networks on profile' (Facebook, Twitter, YouTube, Ask, Google Plus and more.)

These are just suggestions for a beginner forum. Just pointed out that I missed of the forums related to Brazil.

- Peace and Boredom to everyone.


8
RMXP Script Database / Re: [XP] Mouse Window API
February 04, 2013, 01:09:20 am
[Sorry to revive this topic and sorry 'bout my english. I'm from Brazil.]

Very goog script. This is wonderful. But his look is ugly.
I wish it were possible to use a Windowskin in a window that is draggable and closable.

Can i do this? How?

#Edit:
Example of Windowskin:
9
RMXP Script Database / Re: [XP] RMX-OS
January 07, 2013, 11:12:43 am
Quote from: Blizzard on January 07, 2013, 10:44:32 am
Press Windows Key + R, type "cmd" (without the ") and press ENTER. Now type "ipconfig" and press ENTER. This should list your LAN IP address (it will most probably look like 192.168.*.*). Try using that one instead of 127.0.0.1.
You are trying to run the server and the game on the same computer, right?


Don't works too. Yes, in same computer. But, i will forget this for a time.. some months. My 'provisory' computer is  much slow, and don't run Anti-Malware,and my computer are infected now, so i'am will install some Linux OS. Because not have a lot of malwares. But, don't works RMXP  :'(
Tnx, when i win a new computer i will try to fix this problem again.
10
RMXP Script Database / Re: [XP] RMX-OS
January 07, 2013, 10:15:26 am
Hi everybody. I'am from Brazil! (Land of "Samba", "Best Soccer of the World!" :naughty: and.. "The best fuc... corruption.. :facepalm:)

Fine. I can't make RMX - OS works!!! I do everything but when i start de game, Localhost appears "Offline"

Here some screens...
Spoiler: ShowHide

Spoiler: ShowHide

Spoiler: ShowHide

Spoiler: ShowHide

------------------------------------------------------------------------------
Someone can say what i doing wrong? I try to disable firewall, add port exception. Everything, but don't works.
The strange thing is that the server say that is running!!!


[Sorry about my english.. I'am a not expert ang Google Translator suc.. and i don't use that sh..]