Możliwość, jak najbardziej,
jest.
Oprócz samego skryptu potrzebne są:
- serwer - wpisz sobie "free hosting" w Google;
- znajomość MySQL/PHP/HTML5 (wszystkie poradniki znajdziesz spokojnie w internecie za darmo).
- edytor HTML/PHP (
np. Notepad++)
Wbrew pozorom, to nie jest takie trudne, zwłaszcza jak ktoś wytłumaczy to łopatologiczne.
Aby znaleźć skrypt, wystarczy wpisać "webkit rgssx" w Google, gdzie x oznacza wersję Makera (1 - XP; 2 - VX; 3 - VXA)
Tutaj masz uniwersalny:
[spoiler]
=begin
===============================================================================
EFE's Request Script
Version: RGSS & RGSS2 & RGSS3
Special thanks : Ryex, Gustavo Bicalho, Kubiwa Taicho
===============================================================================
This script will allow to request to some servers WITHOUT posting.(Only GET)
--------------------------------------------------------------------------------
Used WINAPI functions:
WinHTTPOpen
WinnHTTLConnect
WinHTTPOpenRequest
WinHTTPSendRequest
WinHTTPReceiveResponse
WinHttpQueryDataAvailable
WinHttpReadData
Call:
EFE.request(host, path, post, port)
host : "www.rpgmakervxace.net" (without http:// prefix)
path : "/forum/login.php" ( the directory path of your php file )
post : "username=kfdsfdsl&password=24324234"
port : 80 is default.
=end
module EFE
# I took this method from Gustavo Bicalho's WebKit script. Special thanks him.
def self.to_ws(str)
str = str.to_s();
wstr = "";
for i in 0..str.size
wstr += str[i,1]+"\0";
end
wstr += "\0";
return wstr;
end
#EFES_WINAPI = Win32API.new('ods', 'naber', 'pp', 'p')
WinHttpOpen = Win32API.new('winhttp','WinHttpOpen',"PIPPI",'I')
WinHttpConnect = Win32API.new('winhttp','WinHttpConnect',"PPII",'I')
WinHttpOpenRequest = Win32API.new('winhttp','WinHttpOpenRequest',"PPPPPII",'I')
WinHttpSendRequest = Win32API.new('winhttp','WinHttpSendRequest',"PIIIIII",'I')
WinHttpReceiveResponse = Win32API.new('winhttp','WinHttpReceiveResponse',"PP",'I')
WinHttpQueryDataAvailable = Win32API.new('winhttp', 'WinHttpQueryDataAvailable', "PI", "I")
WinHttpReadData = Win32API.new('winhttp','WinHttpReadData',"PPIP",'I')
#WinHttpWriteData = Win32API.new('winhttp','WinHttpWriteData',"PPIP",'I')
def self.request2(host, path, post="")
pr = path
if(post != "")
pr = pr + "?" + post
end
pr = pr.to_s
a = EFES_WINAPI.call(to_ws(host), to_ws(pr))
return a
end
def self.request(host, path, post="",port=80)
p = path
if(post != "")
p = p + "?" + post
end
p = p.to_s
pwszUserAgent = ''
pwszProxyName = ''
pwszProxyBypass = ''
httpOpen = WinHttpOpen.call(pwszUserAgent, 0, pwszProxyName, pwszProxyBypass, 0)
if httpOpen
httpConnect = WinHttpConnect.call(httpOpen, to_ws(host), port, 0)
if httpConnect
httpOpenR = WinHttpOpenRequest.call(httpConnect, nil, to_ws(p), "", '',0,0)
if httpOpenR
httpSendR = WinHttpSendRequest.call(httpOpenR, 0, 0 , 0, 0,0,0)
if httpSendR
httpReceiveR = WinHttpReceiveResponse.call(httpOpenR, nil)
if httpReceiveR
received = 0
httpAvailable = WinHttpQueryDataAvailable.call(httpOpenR, received)
if httpAvailable
ali = ' '*1024
n = 0
httpRead = WinHttpReadData.call(httpOpenR, ali, 1024, o=[n].pack('i!'))
n=o.unpack('i!')[0]
return ali[0, n]
else
msgbox_p("Error about query data available")
end
else
msgbox_p("Error when receiving response")
end
else
msgbox_p("Error when sending request")
end
else
msgbox_p("Error when opening request")
end
else
msgbox_p("Error when connecting to the host")
end
else
msgbox_p("Error when opening connection")
end
end
end
[/spolier]
Demo (RM VXA) dostępne jest
na tej stronie.
Ten skrypt powyżej działa tak jakby jak przeglądarka internetowa, tylko całą zawartość pobiera do stringa ("").
Plik
musi być na serwerze i
musi być w formacie [.php].
Przykładowy kod w PHP wygląda tak:
<?php include("connection.php");
$username = $_GET["username"];
$query="SELECT points FROM users WHERE username = '$username'";
$sonuc = mysql_query($query,$connection);
$row = mysql_fetch_array($sonuc);
echo $row[0];
mysql_close($connection);
?>
Akurat ten kod bierze z bazy punkty.
Do RPG Makera dostaje się to, co zostało wywołane poleceniem
echo.
Podstawy języka PHP znajdziesz
tutaj.
Musisz sobie poczytać o formule GET (HTML/PHP) i o bazach MYSQL.
To tyle. Spokojnie, też sięz tym męczę.