Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

2 Pages V   1 2 >  
Reply to this topicStart new topic
> RM Web Browser, Access website from your game
berka
post Aug 4 2009, 08:13 AM
Post #1


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




RM Web Browser
Version: 1.0
By: Berka


Introduction

Now, you're able to launch a web browser directly in the Rgss Player.

Features

  • Esc key quits the browser
  • The Maximize Window button is activated. You can resize your rgss player


Screenshots

Is it really usefull ?

Demo

None

Script

The dll: copy it into the root of your project:
there

CODE
#===============================================================================
#                              RM Web Browser                             4/8/09
#-------------------------------------------------------------------------------
#  par Berka                        v 1.0                           rgss 1 & 2        
#-------------------------------------------------------------------------------
# Display a web browser in the rgss player.
#  - NEED the cwebpage.dll. It HAS TO be placed on the root of the project.
#  - Esc to close the browser, F5, Back keys
#  - Clic on the maximize button to resize the window
#  call: Net.browser("http://rpgmakervx.1fr1.net")
#===============================================================================

wdll="cwebpage.dll"
GPPS = Win32API.new('kernel32', 'GetPrivateProfileString', 'pppplp', 'l')
FW   = Win32API.new('user32',   'FindWindow',              'pp',     'i')
SWL  = Win32API.new('user32',   'SetWindowLong',           'lll',    'l')
GCR  = Win32API.new('user32',   'GetClientRect',           'lp',     'i')
GAKS = Win32API.new('user32',   'GetAsyncKeyState',        'i',      'i')
EBO  = Win32API.new(wdll,       'EmbedBrowserObject',      'l',      'i')
DHP  = Win32API.new(wdll,       'DisplayHTMLPage',         'lp',     'i')
RB   = Win32API.new(wdll,       'ResizeBrowser',           'lll',    'i')
UEBO = Win32API.new(wdll,       'UnEmbedBrowserObject',    'l',      'l')
DPA  = Win32API.new(wdll,       'DoPageAction',            'll',     'l')
def handle
  GPPS.call("Game","Title","",title="\0"*256,256,".//Game.ini")
  FW.call("RGSS Player",title.delete!("\0"))
end

SWL.call(handle,-16,0x10C70000|0x00080000)

def dimensions
  GCR.call(handle,rect=[0,0,0,0].pack('l4'))
  rect.unpack('l4')[2..3]
end
module Net
  def self.browser(url)
    EBO.call(handle)
    DHP.call(handle,url)
    RB.call(handle,*dimensions)
    loop do
      break if GAKS.call(0x1b)&0x01==1
      DPA.call(handle,0)if GAKS.call(0x08)&0x01==1
      DPA.call(handle,4)if GAKS.call(0x74)&0x01==1
      RB.call(handle,*dimensions)
    end
    UEBO.call(handle)
  end
end
Net.browser("http://rpgmakervx.1fr1.net")


Instructions

See comments in the script, please.

Compatibility

Does not work for RMXP: hangup bugs.

Credits and Thanks

Notepad++, for his hexadecimal browser.
The Dll's creator.

Terms and Conditions

Free for use... but DO NOT post my script everywhere whithout permission. Thanks !

best regards,

berka

This post has been edited by berka: Aug 4 2009, 09:02 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Speed@
post Aug 4 2009, 08:35 AM
Post #2


Level 12
Group Icon

Group: Revolutionary
Posts: 203
Type: None
RM Skill: Undisclosed




You are the best french rgss2 scripter! This will provably be used as a framework in Phoenix script and Enix 2 (MMORPG)
Go to the top of the page
 
+Quote Post
   
Speed@
post Aug 4 2009, 09:52 AM
Post #3


Level 12
Group Icon

Group: Revolutionary
Posts: 203
Type: None
RM Skill: Undisclosed




OK, I tested it, i don't like how it blacks out for a few seconds if I write something or click and such.
Go to the top of the page
 
+Quote Post
   
JoRu
post Aug 4 2009, 10:45 AM
Post #4


The 15-year old Swedish Meatball
Group Icon

Group: Revolutionary
Posts: 280
Type: Developer
RM Skill: Advanced




A little buggy (for example, if I call the script from an event the map I called it from reappears for a few seconds while I'm browsing sometimes) but otherwise it works surprisingly well! Could be useful! smile.gif


__________________________


Stay tuned for more information about Fairytale. To stay updated on all my project videos, visit my YouTube page!

QUOTE (JoRu)
Life is a game!
Go to the top of the page
 
+Quote Post
   
silvershadic
post Aug 4 2009, 11:10 AM
Post #5


Bringer of fried chicken
Group Icon

Group: Revolutionary
Posts: 107
Type: Developer
RM Skill: Intermediate




It opens up the webpage at the beginning of the game, and when i try to call it it doesn't work. i get the error message:

Argument error occurred while running the script

wrong number of arguments (0 of 1)

It opens up the webpage at the beginning of the game, and when i try to call it it doesn't work. i get the error message:

Argument error occurred while running the script

wrong number of arguments (0 of 1)
Go to the top of the page
 
+Quote Post
   
berka
post Aug 4 2009, 11:38 AM
Post #6


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




Well, the last line of the script is a sample call.
You have to remove it before using that.
And you can replace the url by your own.

berka


__________________________
Go to the top of the page
 
+Quote Post
   
silvershadic
post Aug 4 2009, 11:50 AM
Post #7


Bringer of fried chicken
Group Icon

Group: Revolutionary
Posts: 107
Type: Developer
RM Skill: Intermediate




QUOTE (berka @ Aug 4 2009, 12:38 PM) *
Well, the last line of the script is a sample call.
You have to remove it before using that.
And you can replace the url by your own.

berka

this is what my script looks like:
CODE
#=================================================================
==============
# RM Web Browser 4/8/09
#-------------------------------------------------------------------------------
# par Berka v 1.0 rgss 1 & 2
#-------------------------------------------------------------------------------
# Display a web browser in the rgss player.
# - NEED the cwebpage.dll. It HAS TO be placed on the root of the project.
# - Esc to close the browser, F5, Back keys
# - Clic on the maximize button to resize the window
# call: Net.browser("http://rpgmakervx.1fr1.net")
#===============================================================================

wdll="cwebpage.dll"
GPPS = Win32API.new('kernel32', 'GetPrivateProfileString', 'pppplp', 'l')
FW = Win32API.new('user32', 'FindWindow', 'pp', 'i')
SWL = Win32API.new('user32', 'SetWindowLong', 'lll', 'l')
GCR = Win32API.new('user32', 'GetClientRect', 'lp', 'i')
GAKS = Win32API.new('user32', 'GetAsyncKeyState', 'i', 'i')
EBO = Win32API.new(wdll, 'EmbedBrowserObject', 'l', 'i')
DHP = Win32API.new(wdll, 'DisplayHTMLPage', 'lp', 'i')
RB = Win32API.new(wdll, 'ResizeBrowser', 'lll', 'i')
UEBO = Win32API.new(wdll, 'UnEmbedBrowserObject', 'l', 'l')
DPA = Win32API.new(wdll, 'DoPageAction', 'll', 'l')
def handle
GPPS.call("Game","Title","",title="\0"*256,256,".//Game.ini")
FW.call("RGSS Player",title.delete!("\0"))
end

SWL.call(handle,-16,0x10C70000|0x00080000)

def dimensions
GCR.call(handle,rect=[0,0,0,0].pack('l4'))
rect.unpack('l4')[2..3]
end
module Net
def self.browser(url)
EBO.call(handle)
DHP.call(handle,url)
RB.call(handle,*dimensions)
loop do
break if GAKS.call(0x1b)&0x01==1
DPA.call(handle,0)if GAKS.call(0x08)&0x01==1
DPA.call(handle,4)if GAKS.call(0x74)&0x01==1
RB.call(handle,*dimensions)
end
UEBO.call(handle)
end
end


and this is my call:
CODE
Net.browser
("http://theendlesswar.ning.com/")
Go to the top of the page
 
+Quote Post
   
berka
post Aug 4 2009, 11:56 AM
Post #8


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




try that:
CODE
Net.browser("http://theendlesswar.ning.com/")

or, if you havn't enough space:
CODE
Net.browser(
"http://theendlesswar.ning.com/")


__________________________
Go to the top of the page
 
+Quote Post
   
silvershadic
post Aug 4 2009, 12:00 PM
Post #9


Bringer of fried chicken
Group Icon

Group: Revolutionary
Posts: 107
Type: Developer
RM Skill: Intermediate




QUOTE (berka @ Aug 4 2009, 12:56 PM) *
try that:
CODE
Net.browser("http://theendlesswar.ning.com/")

or, if you havn't enough space:
CODE
Net.browser(
"http://theendlesswar.ning.com/")

thanks it works
Go to the top of the page
 
+Quote Post
   
Speed@
post Aug 5 2009, 01:36 AM
Post #10


Level 12
Group Icon

Group: Revolutionary
Posts: 203
Type: None
RM Skill: Undisclosed




Hey berka, you should tweak the update method more, while you click on something or write, it either shows a black screen, if launching directly, or if from a map, it shows the map you launched it from for a few seconds.
Go to the top of the page
 
+Quote Post
   
Herendil
post Aug 5 2009, 02:37 AM
Post #11



Group Icon

Group: Member
Posts: 3
Type: None
RM Skill: Undisclosed




Oh yes, this is very useful!
I looked for a way to show mein Handbook ingame and and with this here I can call it as a PDF by Script!
I love it!

Edit: Oh man, there is a major bug: If I resize the Window by clicking the button, the window isn´t really 544*416 px! In addition I can pull the window bigger when I pull at the corners.... Pls fix this....

This post has been edited by Herendil: Aug 5 2009, 03:38 AM
Go to the top of the page
 
+Quote Post
   
AmIMeYet
post Aug 5 2009, 03:47 AM
Post #12


new av & (dynamic) sig!
Group Icon

Group: Revolutionary
Posts: 149
Type: Scripter
RM Skill: Undisclosed




Pretty nice smile.gif

Oh, and the dll's creator is called Jeff Glatt.
I will add though, that there are some security issues with this (using IE as a base is not the brightest idea ever; almost no security), and there are some possible memory leaks, etc.

So guys, be carefull what url you throw at your users!


__________________________

>>Latest EventScripter news: Conditional Branches fully working! Currently working on a documentation site. Topic: EventScripter
>>Portals (yes, in RPG Maker VX!)
>>Working with Sojabird on his Scriptology; I also invented Scriptuzzle.. Try one; make one!
[Show/Hide] USEFULL script snippets:
[Show/Hide] Do require's in VX:
CODE
$LOAD_PATH << Dir.getwd #You only need to call this once
Kernel.require("includable.rb") #replace includable.rb with the name of the file you want to load
[Show/Hide] Invert Dash enabling:
CODE
#=============================================================================#
# # #                            ANTI DASH HACK                           # # #
# # #                              By AmIMeYet                            # # #
# # #                           please credit me                          # # #
#=============================================================================#
class Game_Player < Game_Character
  def dash?
    return false if @move_route_forcing
    return false if in_vehicle?
    return true if Input.press?(Input::A) and $game_map.disable_dash?
  end
end

This snippet basically inverts the dashing.. allowing you to dash only when 'disable dashing' is checked.
This way, normal maps disable dashing, but the ones you set to disable actually allow dashing..

It should be placed where you normally place the scripts ('above main', in the materials section of the scripts window)..
Go to the top of the page
 
+Quote Post
   
onidsouza
post Aug 5 2009, 03:01 PM
Post #13


image master of doom
Group Icon

Group: Revolutionary
Posts: 603
Type: None
RM Skill: Undisclosed




Great! It supports php, JavaScripts, RubyOnRails and all that special stuff?

Not planning to use it, but will be good to know!


__________________________
Gabba Gabba Hey! enjoy your life ^^
lol (by keet's brother)
some lol
more lol
even MORE lol
Serious Discussion
why all my lol's have Teh Parakeet involved?

me ^^

bacon

Spamming is always better with bacon
Go to the top of the page
 
+Quote Post
   
ZeroFrost
post Dec 24 2009, 04:21 PM
Post #14


SpirioCreatures, Inc. Founder
Group Icon

Group: Revolutionary
Posts: 161
Type: Developer
RM Skill: Intermediate




is there anyway to make the internet part of this just a small hud. i might link my forum's chat window into the game


__________________________
Go to the top of the page
 
+Quote Post
   
Xzygon
post Dec 24 2009, 04:40 PM
Post #15


Pineapple Inc's President and Creator of Duality Online
Group Icon

Group: Revolutionary
Posts: 554
Type: Writer
RM Skill: Skilled




Lol, necroposter!

As far as I can tell, no, there's no way to make it into an HUD. It put the WHOLE browser into the game, it doesn't turn it into a little hud.
Even if you can turn it into a HUD, you'll have to make it center exactly onto the chat window and lock it there, otherwise the player can just move about the window and exit the chat altogether, and I'm pretty sure you don't want that.


__________________________
Check out my game, Duality Online!
Duality Online






Blah
A saying that I DID NOT STEAL FROM KUNG FU PANDA!
Today is a Gift.
That's why they call it the Present.
You never know what's inside,
Because the Present is always changing.
~Made it up with my cuz 7 Years Ago, without the help of anybody else~


Don't read!
00110000001100010011000000110000001100010011000000110000001100000011000000
11000100110001001100000011000000110000001100000011000100110000001100010011000100
1
10000001100010011000000110000001100000011000000110001001100010011000000110000001
1
00000011000000110001001100000011000000110001001100000011000100110001001100000011
0
00000110000001100000011000100110000001100000011000000110000001100000011000000110
0
01001100010011000000110000001100010011000000110001001100000011000100110001001100
0
10011000000110000001100000011000000110000001100010011000100110000001100010011000
0
00110000001100010011000000110001001100010011000000110000001100000011000100110001
0
01100000011000000110001001100000011000000110000001100000011000000110000001100010
0
11000100110000001100000011000100110001001100000011000000110001001100010011000000
1
10000001100000011000000110001001100000011000100110001001100000011000100110000001
1
00000011000100110000001100010011000100110000001100010011000100110000001100000011
0
00000110000001100010011000000110000001100000011000000110000001100000011000100110
0
01001100000011000000110001001100010011000000110000001100010011000100110000001100
0
10011000100110001001100010011000000110001001100010011000100110000001100000011000
1
00110000001100000011000000110001001100000011000000110000001100000011000000110000
0
01100010011000100110000001100000011000100110000001100000011000000110001001100010
0
11000000110001001100010011000100110001001100000011000100110001001100010011000000
1
10001001100000011000100110000001100010011000100110000001100000011000000110001001
1
00000011000000110001001100010011000000110001001100010011000000110000001100000011
0
00100110001001100000011000000110001001100000011000100110000001100000011000100110
0
00001100000011000000110000001100000011000000110001001100010011000000110000001100
0
10011000000110000001100000011000100110001001100000011000000110001001100000011000
1
00110000001100010011000100110000001100000011000000110001001100010011000000110001
0
01100010011000100110000001100000011000100110000001100000011000100110001001100010
0
11000100110000001100000011000100110000001100010011000100110001001100000011000000
1
10000001100000011000000110001001100010011000100110000001100010011000000110000001
1
00000011000100110001001100000011000100110000001100000011000100110000001100010011
0
00100110000001100010011000100110001001100000011000000110001001100010011000000110
0
00001100010011000100110001001100000011000000110001001100000011000000110000001100
0
00011000000110000001100010011000100110001001100000011000100110000001100000011000
0
00110001001100010011000000110001001100000011000000110000001100000011000100110001
0
01100000011000100110000001100000011000100110000001100010011000100110001001100000
0
11000000110001001100010011000000110000001100010011000000110000001100000011000000
1
10000001100000011000100110001001100000011000000110000001100010011000000110000001
1
00010011000100110000001100010011000000110000001100010011000000110001001100010011
0
00000110001001100010011000100110000001100000011000100110001001100000011000000110
0
00001100000011000100110000001100010011000100110001001100000011000000110001001100
0
00011000000110001001100010011000100110001001100000011000000110001001100000011000
0
00110001001100000011000000110000001100000011000000110000001100010011000100110000
0
01100000011000000110001001100010011000000110001001100010011000000110001001100010
0
11000100110001001100000011000100110001001100000011000000110001001100000011000000
1
10000001100010011000100110000001100000011000100110000001100010011000000110000001
1
00010011000000110001001100010011000100110000





I support
Supporting


Go to the top of the page
 
+Quote Post
   
ZeroFrost
post Dec 30 2009, 04:34 PM
Post #16


SpirioCreatures, Inc. Founder
Group Icon

Group: Revolutionary
Posts: 161
Type: Developer
RM Skill: Intermediate




i got the

wrong number of arguments (0 of 1) popup... idk why it does that but could someone help????

EDIT: now i get the Syntax error thing... anyone know a fix for that/


__________________________
Go to the top of the page
 
+Quote Post
   
Speed@
post Dec 31 2009, 02:19 AM
Post #17


Level 12
Group Icon

Group: Revolutionary
Posts: 203
Type: None
RM Skill: Undisclosed




QUOTE (sailorspx @ Dec 30 2009, 05:34 PM) *
i got the

wrong number of arguments (0 of 1) popup... idk why it does that but could someone help????

EDIT: now i get the Syntax error thing... anyone know a fix for that/

Nobody yet got this error, so you must have been trying to do something yourself. And as we cannot see what you did (script code) we cannot help. Also for the Syntax error, that's usually the easiest error to fix, if you look at the script. But we cannot see the code so = no help.

Go to the top of the page
 
+Quote Post
   
ZeroFrost
post Jan 4 2010, 04:43 PM
Post #18


SpirioCreatures, Inc. Founder
Group Icon

Group: Revolutionary
Posts: 161
Type: Developer
RM Skill: Intermediate




if ya wanna see what im using, scroll up and look at that one but take out the last line and thats what i have


__________________________
Go to the top of the page
 
+Quote Post
   
dokdo2005
post Jan 5 2010, 06:31 AM
Post #19



Group Icon

Group: Member
Posts: 3
Type: Event Designer
RM Skill: Skilled




Can I post your script on another site, "http://www.niotsoft.com"?
Go to the top of the page
 
+Quote Post
   
berka
post Jan 5 2010, 02:52 PM
Post #20


Level 8
Group Icon

Group: Revolutionary
Posts: 111
Type: Scripter
RM Skill: Advanced




@dokdo: Yes, you can. Thanks for asking !
@sailorspx: could you post your call there ?

regards,
berka


__________________________
Go to the top of the page
 
+Quote Post
   

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 25th May 2013 - 02:58 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker