Sujet n°6977
Posté par CollosalPokemon le 4 Juin - 06:39 (2010)
Titre : [Script] Navigateur de Web de RMXP (PSP SK aussi)
Bonjour Membre de PSP,

(Désolé du mauvais fait de parler français, je suis le cours de français)

INTRODUCTION

Je vois ce jour le script de Navigateur de Web de RM pour RMVX et je fais la modification pour travailler dans RMXP et il n'importe pas dans que kit il utilise je le rends si bien adaptable par automatiquement.

Pourtant, il contient vraiment un peu d'insecte que je finis sur l'action. Car maintenant les TRAVAUX de navigateur mais u doivent avoir votre souris claquant chacun où dans la Fenêtre RGSS pour la page Web à visible.

CARACTÉRISTIQUES

* Parcourir le web dans votre RGSS / 2 Joueur. (RMVX ou RMXP)
* DLL a utilisé donc il aura le traitement lisse.
* Aucun script de souris n'a besoin de vous! Il fixe le navigateur sur RGSS / 2 Joueur!
* CONNECTER ET LE JEU!

UTILISER

Utilisez-le par Net.browser("L'URL de Votre Site Internet")
Rendez-vous sûrs vous mettez dll dans l'annuaire [Votre Jeu] / Data /
la chemise et LE REBAPTISEZ à WebBrowser.dll!!!

SCRIPT

Voici le script vous aurez aussi besoin du dll. Arrivez à partir d'ici http://www.mediafire.com/download.php?0z1kzzlzwdm

Script :

Code:

#==============================================================================#
#                              RMXP/RMVX Web Browser                           #
#------------------------------------------------------------------------------#
#  Original script by Berka                                                    #
#  Modified by Armorphor (aka CollosalPokemon)                                 #
#  Version: 2.1                                                                #
#  Date: 04.08.2009                                                            #
#  Last Modification: 03.01.2010                                               #
#  - DON'T POST THIS SCRIPT ANYWHERE WITHOUT PERMISSION.                       #
#  - GIVE CREDITS WHERE THEY ARE NEEDED.                                       #
#------------------------------------------------------------------------------#
# HOWTO:                                                                       #
#                                                                              #
#  - Copy WebBrowser.dll to your /Data/ folder.                                #
#  - To close the browser you can use the Esc, F5, or the Back keys            #
#  - If you're using VX then change "$RMXP = true" to "$RMXP = false" otherwise#
#  DON'T change it.                                                            #
#                                                                              #
# Current Bugs/Glitches:                                                       #
#                                                                              #
# - Page is black if the mouse does not click on a spot that does something.(?)#
# - Can't guarantee it'll work with the SDKs but I don't know why it wouldn't  #
# b/c it doesn't alias anything in RMXP or RMVX that has to do with anything   #
# the SDK uses. But still, not tested yet.                                     #
#                                                                              #
# Removed Features:                                                            #
#                                                                              #
# - Resizing the Game Window. Reason: Not ideal for other scripts and processes#
#==============================================================================#
# Changelog:                                                                   #
#                                                                              #
# v1.0 (04.08.2009) (Public)                                                   #
#    --> Initial Release (For RPG Maker VX and NOT RPG Maker XP)               #
#                                                                              #
# v2.0 (02.25.2010) (Not Public)                                               #
#    --> Support for RMXP brought. (Albeit a bit buggy)                        #
#    --> Rewritten details behind the hashes (#)                               #
#    --> Renamed DLL and checking if you have it (Ensures the script can run)  #
# v2.1 (03.01.2010) (Public)                                                   #
#    --> Patch created so it is guarantee to work in RMVX and RMXP.            #
#    --> Maintenance.                                                          #
#==============================================================================#
#  Call using: Net.browser("URL")                                              #
#  Of course replace URL with a URL to go to.                                  #
#==============================================================================#

class Win32API
 @@RGSSWINDOW=nil
 @@GetCurrentThreadId=Win32API.new('kernel32','GetCurrentThreadId', '%w()','l')
 @@GetWindowThreadProcessId=Win32API.new('user32','GetWindowThreadProcessId', '%w(l p)','l')
 @@FindWindowEx=Win32API.new('user32','FindWindowEx', '%w(l l p p)','l')
 def Win32API.SetWindowText(text)
   hWnd =  pbFindRgssWindow
   swp = Win32API.new('user32', 'SetWindowTextA', %(l, p), 'i')
   swp.call(hWnd, text)
 end
 # Added by Peter O. as a more reliable way to get the RGSS window
 def Win32API.pbFindRgssWindow
  return @@RGSSWINDOW if @@RGSSWINDOW
  processid=[0].pack('l')
  threadid=@@GetCurrentThreadId.call
  nextwindow=0
  begin
   nextwindow=@@FindWindowEx.call(0,nextwindow,"RGSS Player",0)
   if nextwindow
     wndthreadid=@@GetWindowThreadProcessId.call(nextwindow,processid)
     if wndthreadid==threadid
      @@RGSSWINDOW=nextwindow
      return @@RGSSWINDOW
     end
   end
  end until nextwindow==0
  raise "Can't find RGSS player window"
  return 0
 end
 def Win32API.GetPrivateProfileString(section, key)
   val = "\0"*256
   gps = Win32API.new('kernel32', 'GetPrivateProfileString',%w(p p p p l p), 'l')
   gps.call(section, key, "", val, 256, ".\\Game.ini")
   val.delete!("\0")
   return val
 end
 def Win32API.SetWindowPos(w, h)
   hWnd =  pbFindRgssWindow
   windowrect=Win32API.GetWindowRect
   clientsize=Win32API.client_size
   xExtra=windowrect.width-clientsize[0]
   yExtra=windowrect.height-clientsize[1]
   swp = Win32API.new('user32', 'SetWindowPos', %(l, l, i, i, i, i, i), 'i')
   win = swp.call(hWnd, 0, windowrect.x, windowrect.y,
     w+xExtra,h+yExtra, 0)
   return win
 end
 def Win32API.client_size
   hWnd =  pbFindRgssWindow
   rect = [0, 0, 0, 0].pack('l4')
   Win32API.new('user32', 'GetClientRect', %w(l p), 'i').call(hWnd, rect)
   width, height = rect.unpack('l4')[2..3]
   return width, height
 end
 def Win32API.GetWindowRect
   hWnd =  pbFindRgssWindow
   rect = [0, 0, 0, 0].pack('l4')
   Win32API.new('user32', 'GetWindowRect', %w(l p), 'i').call(hWnd, rect)
   x,y,width, height = rect.unpack('l4')
   return Rect.new(x,y,width-x,height-y)
 end
end

if FileTest.exist?("Data/WebBrowser.dll") #Ensures n00bs didn't delete the webpage DLL.
  wdll='Data/WebBrowser.dll'
else
  raise ArgumentError.new(_INTL("Error: Web Browsing DLL somehow not found.\nContact the game's owner if the problem persists."))
end

$RMXP = true # If true you're using RMXP, if false, you're using RMVX.(YOU need to edit this)
GPPS  = Win32API.new('kernel32', 'GetPrivateProfileString', 'pppplp', 'l')
FW    = Win32API.new('user32','FindWindowEx', '%w(l l p p)','l')
GCR   = Win32API.new('user32',   'GetClientRect',           'lp',     'i')
GAKS  = Win32API.new('user32',   'GetAsyncKeyState',        'i',      'i')
TID   = Win32API.new('kernel32','GetCurrentThreadId', '%w()','l')
WTPID = Win32API.new('user32','GetWindowThreadProcessId', '%w(l p)','l')
EBO   = Win32API.new(wdll,       'EmbedBrowserObject',      'l',      'i')
DHP   = Win32API.new(wdll,       'DisplayHTMLPage',         'lp',     'i')
UEBO  = Win32API.new(wdll,       'UnEmbedBrowserObject',    'l',      'l')
DPA   = Win32API.new(wdll,       'DoPageAction',            'll',     'l')
if $RMXP==true
def handle
  @@RGSSWINDOW=nil
  processid=[0].pack('l')
  threadid=TID.call
  nextwindow=0
  begin
   nextwindow=FW.call(0,nextwindow,"RGSS Player",0)
   if nextwindow
     wndthreadid=TID.call
     if wndthreadid==threadid
      @@RGSSWINDOW=nextwindow
      return @@RGSSWINDOW
     end
   end
  end until nextwindow==0
  GPPS.call("Game","Title","",title="\0"*255,255,".//Game.ini")
  FW.call(0,nextwindow,"RGSS Player",title.delete!("\0"))
end

def dimensions
  return Win32API.client_size
end

module Net
  def self.browser(url)
    EBO.call(handle)
    DHP.call(handle,url)
     loop do
      sleep(0.1)
      EBO.call(handle)
      DPA.call(handle,0)if GAKS.call(0x08)&0x01==1
      DPA.call(handle,4)if GAKS.call(0x74)&0x01==1
      Graphics.update
      EBO.call(handle)
      DPA.call(handle,0)if GAKS.call(0x08)&0x01==1
      DPA.call(handle,4)if GAKS.call(0x74)&0x01==1
      Input.update
      break if GAKS.call(0x1b)&0x01==1
     end
 UEBO.call(handle)
 end
end
else
def handle
  GPPS.call("Game","Title","",title="\0"*256,256,".//Game.ini")
  FW.call("RGSS Player",title.delete!("\0"))
end

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
  end


JE L'ÉVALUE JE SAIS QU'IL A NOIR L'INTRO S'IL VOUS PLAÎT LUE JE SUIS LE TRAVAIL SUR CELA!


Et c'est fondamentalement cela, si u ont une question demandez s'il vous plaît que j'aie beaucoup de connaissance de RMXP comme le spectacle sur mon jeu Pokemon : Version d'Origine.

le merci pour votre lecture,

~ CP

Posté par Nuri Yuri le 4 Juin - 07:04 (2010)
Hum .... ....
Un navigateur n'est pas forcement utile pour PSP mais pour une application externe ....

Posté par Pαlвσlѕку le 4 Juin - 08:50 (2010)
Un navigateur, ça pourrait être utile, mais il faudrait en trouver une utilité, et sur le coup, je n'en trouve pas.

Sinon, good work. Imbécile heureux

Posté par CollosalPokemon le 9 Juin - 07:42 (2010)
Je travaille le nouveau que le script le pourcentage simple moins de bulky:D Peut-être il est maintenant plein bientôt.   
                             
aussi je note qu'a le sort de questions sont tapés par les claviers ^^ je crois que l'on les dit les mots semblables donc je réponds à tous les deux en même temps. 
     
Je vois quelque chose de possible, l'année peut-être en ligne a des discussions. PSP peut être a plus grand peut-être (le champion de qui nous révisons la grandeur d'écran de PSP a la petite manière) donc le petit script de Page Web contient le Messager Immédiat d'or que quelque chose ainsi u peut parler avec les amis en jouant au jeu ur et avec cela pour là être pas être nécessaire pour a le sort Netplay et MySQL pour parler dans la fenêtre de jeu ^^   
                             
    fait taper le sort de mots maintenant ^^ dont je deviens a le morceau fait fatigué pensent dans le français (je suis l'américain d'année) à tel a bonne nuit, vous voir soon Bouche extensiblek:

Posté par Pαlвσlѕку le 9 Juin - 14:37 (2010)
Ecrit en anglais ou change de traducteur car là j'ai absolument rien compris.

Posté par Solfay1 le 9 Juin - 14:40 (2010)
Yes man, speak english.

Posté par Mini' le 9 Juin - 20:10 (2010)
http://translate.google.fr/#

Clin d'œil foireux (Pour mieux comprendre)

Posté par CollosalPokemon le 9 Juin - 22:36 (2010)
Pardon my french but I wasn't sure if people here knew English very well, judging by the recent comments a handful can read my english better than my french. I don't use translators so I am sorry for the unreadable post. I guess I need a lot more practice than I thought lol

Basically what I was trying to say before was that I am working on a new web browser script that is less bulky and a use I thought of for PSP. My thought was what if PSP's game window was a little bit larger and a web page containing something like a Instant Messager for PSP users was placed below the game, like this but larger screen size:



(Just a concept, does not need to be used) This would give people a good way to help with debugging/testing help directly from RGSS Player without the need to go to a browser.

Posté par Mortenkein le 9 Juin - 23:04 (2010)
English :

Isn't better to create a topic on a forum to ask help? On a forum, there are many more people to help you (unless the forum IS really unpopular ^^), and, obviously, we can use an instant messaging client to talk to others players or with our testers.

Besides, you should rewrite the first message in English, because I'm not sure if I understand well the purpose of your script.

Question : how did you learn the existence of PSP?


Français :

Ne serait-il pas plus approprié de créer un sujet sur un forum pour demander de l'aide? Sur une forum, plein de personnes peuvent nous aider (à moins que le forum est vraiment impopulaire ^^) et, évidemment, on peut communiquer par client de messagerie instantanée avec d'autres joueurs ou avec nos testeurs.

Par ailleurs, tu devrais réécrire le premier message en anglais, car je ne suis pas certain de bien comprendre le but de ton script.

Question : comme as-tu appris l'existence de PSP?

Posté par CollosalPokemon le 10 Juin - 05:57 (2010)
I see your points Mortenkein, will rewrite it to make it readable =P The main goal is to browse the web generally, like google, yahoo, and youtube for example but inside your RGSS Player. What I meant by "Instant Messenger" was a little area on the screen so you can talk to other online players without having to learn all about MySQL and stuff to connect to a database like most other online scripts so the users can put cool HTML/XHTML/SHTML effects into their game. This is a script and not a help request (although edits are welcome, but I am not specifically asking for help) it is a little buggy right now but I'm working my way around it.

I learned of PSP from google, when I looked up Pkmn Starter Kits, although I ended up using Poccil's kit, this one looks very nice and promising though so I am still following it's progress.

Posté par Mortenkein le 10 Juin - 12:56 (2010)
English :

Thanks for the explanations.


Français (traduction libre du message précédent) :

Je vois ce que tu veux dire Mortenkein; je vais réécrire le premier message pour qu'il soit intelligible =P. Le but principal du script est de naviguer sur le Web, sur des sites comme Google, Yahoo!, Youtube, etc., mais à l'intérieur de l'exécutable RGSS. Ce que j'ai voulu dire par « Instant Messenger », c'est qu'au bas de la fenêtre du jeu, il y aurait un espace où échanger en ligne avec d'autres joueurs sans avoir à apprendre MySQL et tout le nécessaire à la connexion d'une base de données. Les autres scripts semblables au mien requièrent cet apprentissage; voilà l'avantage qu'apporte le mien par rapport aux autres. Les utilisateurs peuvent donc profiter des effets intéressants du HTML/XHTML/SHTML directement dans leur jeu. RMXP Web Browser n'est pas un script à utiliser pour demander de l'aide (des modifications peuvent toutefois êtres apportées au script, mais ce n'est pas ce que je recherche en postant mon travail ici). Dans sa forme actuelle, le script souffre de légers bogues que je suis en train de résoudre.

J'ai appris l'existence de PSP en faisant une recherche sur les starters kits Pokémon sur Google. Bien que j'utilise le kit de Poccil (Pokémon Essentials), Pokémon Script Project est très bien et prometteur, et c'est pourquoi je suis son développement.

Posté par Slash le 12 Juin - 10:37 (2010)
Si j'ai bien compris, en exploitant ce script, on pourrait faire un systeme d'echange ??

Posté par Mortenkein le 12 Juin - 13:05 (2010)
C'est plus ou moins un navigateur Web qui peut être utilisé pour communiquer avec des gens sur Internet. Enfin, il faudrait utiliser le script, car ce n'est pas 100 % clair.

Posté par Sphinx le 12 Juin - 20:59 (2010)
Mollasse enragé Après test, sur la page http://www.google.fr, je me rends compte d'un pb ; la page affichée à l'écran ne l'est pas correctement ^^" La map réapparait par dessus, sauf quand le joueur clique qque part