begin process at 2012 02 12 07:53:08
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Scripts

 > GPS - COMMENT TROUVER LES COORDONNÉES D'UN LIEU ET OBTENIR UNE CARTE...

GPS - COMMENT TROUVER LES COORDONNÉES D'UN LIEU ET OBTENIR UNE CARTE...


 Information sur la source

Note :
7 / 10 - par 4 personnes
7,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Scripts Niveau :Initié Date de création :17/11/2003 Date de mise à jour :18/11/2003 17:42:29 Vu :58 185

Auteur : nestor_chat

Ecrire un message privé
Commentaire sur cette source (8)
Ajouter un commentaire et/ou une note

 Description

/GPS Donne la position GPS d'une ville et un lien vers une carte interactive.



Source

  • menu channel {
  • GPS:/GPS
  • }
  • alias cF5 {
  • /msg $active %bot.msg
  • }
  • alias GPS {
  • if ( $1 == $null ) /set %bot-GPS.critere $$?="Entrez une ville ou un code postal"
  • else /set %bot-GPS.critere $$1
  • if ( %bot-GPS.OQP ) {
  • /Echo -at 14,9 $+ - Je suis OQP renouvelez votre demande plus tard.
  • }
  • else {
  • /set %bot-GPS.OQP $true
  • /Echo -at 14,9 $+ - Module GPS By Nestor - Un instant je cherche les informations sur %bot-GPS.critere $+ ...
  • /sockopen GPS fr.maps.yahoo.com 80
  • }
  • }
  • on *:sockopen:GPS:{
  • if ($sockerr > 0) {
  • /sockclose GPS
  • /Echo -at 14,9 $+ - Petit probleme pour avoir les informations... desolé
  • %bot-GPS.OQP = $false
  • /return
  • }
  • /sockwrite -n GPS GET http://fr.maps.yahoo.com//?&csz= $+ %bot-GPS.critere $+ &country=fr
  • }
  • on *:sockread:GPS:{
  • /var %temp
  • if ( $sockerr > 0) {
  • /sockclose GPS
  • /Echo -at 14,9 $+ - Petit probleme pour avoir les informations... desolé
  • /set %bot-GPS.OQP $false
  • /return
  • }
  • /sockread -f %temp
  • while ( $sockbr != 0) {
  • ;----------------------------------------
  • ;----------------------------------------
  • ; if ( %temp != $null ) /echo -at $replace( %temp , <, 14< , >, >4 )
  • if ( Mémoriser cette adresse isin %temp ) {
  • %temp = $right( %temp , $calc( $len( %temp ) - $pos( %temp, city= ) - 4 ) )
  • %bot-Gps.City = $remove( $left( %temp , $calc( $pos( %temp, % $+ 26 ) - 1) ), %,0,1,2,3,4,5,6,7,8,9 )
  • %temp = $right( %temp , $calc( $len( %temp ) - $pos( %temp, slt= ) - 3 ) )
  • %bot-Gps.NS = $left( %temp , $calc( $pos( %temp, % $+ 26 ) - 1) )
  • %temp = $right( %temp , $calc( $len( %temp ) - $pos( %temp, sln= ) - 3 ) )
  • %bot-Gps.EO = $left( %temp , $calc( $pos( %temp, % $+ 26 ) - 1) )
  • %temp = $right( %temp , $calc( $len( %temp ) - $pos( %temp, zip= ) - 3 ) )
  • %bot-Gps.ZIP = $left( %temp , $calc( $pos( %temp, % $+ 26 ) - 1) )
  • %bot.msg = [GPS] %bot-Gps.City ( $+ %bot-Gps.ZIP $+ ) $iif( %bot-Gps.NS > 0, Nord:, Sud: ) $remove( %bot-Gps.NS, - ) $&
  • $iif( %bot-Gps.EO > 0, Est:, Ouest: ) $remove( %bot-Gps.EO, - )
  • /echo -at 14,9 $+ %bot.msg
  • }
  • if ( Version imprimable isin %temp ) && ( alt !isin temp ) {
  • %bot-Gps.temp = $remove( %Bot-Gps.temp, <a href=", "> )
  • %bot-Gps.temp = $replace( %Bot-Gps.temp, mag=5, mag=2 )
  • ; Vous pouvez choisir de ne pas afficher la carte
  • /echo -at 14,9 $+ - Carte: 9,14 $+ http://fr.maps.yahoo.com $+ %Bot-Gps.temp $+ 10,9 Clickez sur le lien.
  • /run http://fr.maps.yahoo.com $+ %Bot-Gps.temp
  • }
  • %Bot-Gps.temp = %temp
  • ;----------------------------------------
  • ;----------------------------------------
  • /sockread -f %temp
  • }
  • }
  • on *:sockclose:GPS: {
  • if ( !%bot-Gps.City ) {
  • /Echo -at 14,9 $+ - Je ne trouve rien dans ma base sur %bot-GPS.critere $+ .
  • /Echo -at 14,9 $+ - Changer votre critere.
  • }
  • /echo -at 14,9 $+ - C'est tout pour aujourd'hui.
  • /unset %bot-GPS.*
  • }
menu channel {
  GPS:/GPS
}

alias cF5 {
  /msg  $active %bot.msg
}

alias GPS {
  if ( $1 == $null )  /set %bot-GPS.critere $$?="Entrez une ville ou un code postal"
  else /set %bot-GPS.critere $$1
  if ( %bot-GPS.OQP ) { 
    /Echo -at 14,9 $+ -   Je suis OQP renouvelez votre demande plus tard.
  }
  else {
    /set %bot-GPS.OQP $true
    /Echo -at 14,9 $+ -   Module GPS By Nestor -  Un instant je cherche les informations sur %bot-GPS.critere $+ ...
    /sockopen GPS fr.maps.yahoo.com 80
  }
}

on *:sockopen:GPS:{
  if ($sockerr > 0) {
    /sockclose GPS
    /Echo -at 14,9 $+ -  Petit probleme pour avoir les informations... desolé
    %bot-GPS.OQP = $false
    /return
  }
  /sockwrite -n GPS GET http://fr.maps.yahoo.com//?&csz= $+ %bot-GPS.critere $+ &country=fr 
}

on *:sockread:GPS:{
  /var %temp
  if ( $sockerr > 0) {
    /sockclose GPS
    /Echo -at 14,9 $+ -  Petit probleme pour avoir les informations... desolé
    /set %bot-GPS.OQP $false
    /return
  }
  /sockread -f %temp
  while ( $sockbr != 0) {
    ;----------------------------------------
    ;----------------------------------------
    ;    if ( %temp != $null ) /echo -at $replace( %temp , <, 14< , >, >4 )
    if ( Mémoriser cette adresse isin %temp ) {
      %temp = $right( %temp , $calc( $len( %temp ) - $pos( %temp, city= ) - 4 ) )
      %bot-Gps.City = $remove( $left( %temp , $calc( $pos( %temp, % $+ 26 ) - 1) ), %,0,1,2,3,4,5,6,7,8,9 )
      %temp = $right( %temp , $calc( $len( %temp ) - $pos( %temp, slt= ) - 3 ) )
      %bot-Gps.NS = $left( %temp , $calc( $pos( %temp, % $+ 26 ) - 1) )
      %temp = $right( %temp , $calc( $len( %temp ) - $pos( %temp, sln= ) - 3 ) )
      %bot-Gps.EO = $left( %temp , $calc( $pos( %temp, % $+ 26 ) - 1) )
      %temp = $right( %temp , $calc( $len( %temp ) - $pos( %temp, zip= ) - 3 ) )
      %bot-Gps.ZIP = $left( %temp , $calc( $pos( %temp, % $+ 26 ) - 1) )
      %bot.msg = [GPS] %bot-Gps.City ( $+ %bot-Gps.ZIP $+ ) $iif( %bot-Gps.NS > 0, Nord:, Sud: ) $remove( %bot-Gps.NS, - ) $&
        $iif( %bot-Gps.EO > 0, Est:, Ouest: ) $remove( %bot-Gps.EO, - )
      /echo -at 14,9 $+ %bot.msg
    }
    if ( Version imprimable isin %temp ) && ( alt !isin temp ) {
      %bot-Gps.temp = $remove( %Bot-Gps.temp, <a href=", "> )
      %bot-Gps.temp = $replace( %Bot-Gps.temp, mag=5, mag=2 )
     ; Vous pouvez choisir de ne pas afficher la carte
      /echo -at 14,9 $+ -  Carte: 9,14 $+ http://fr.maps.yahoo.com $+ %Bot-Gps.temp $+ 10,9 Clickez sur le lien.
     /run http://fr.maps.yahoo.com $+ %Bot-Gps.temp
    }
    %Bot-Gps.temp = %temp
    ;----------------------------------------
    ;----------------------------------------
    /sockread -f %temp
  }
}

on *:sockclose:GPS: {
  if ( !%bot-Gps.City ) {
    /Echo -at 14,9 $+ -  Je ne trouve rien dans ma base sur %bot-GPS.critere $+ .
    /Echo -at 14,9 $+ -  Changer votre critere.
  }
  /echo -at 14,9 $+ -  C'est tout pour aujourd'hui.
  /unset %bot-GPS.*
}

 Conclusion

- /GPS Ville : vous donne les coordonnées d'un lieu et un lien vers une carte.
- Ctrl F5 : envoie les coordonnées sur le salon ou le PV. vous pouvez toujours modifier la touche si elle ne vous satisfait pas.

Le 18 Nov 2002
- Modif pour tenir compte des remarques.
- Ajout du lancement de la carte.
- Une boite de dialogue feras suite... avec recherche d'un lieu et gestion de l'affichage de la carte.



 Sources du même auteur

GPS VERSION BOITE DE DIALOGUE - COMMENT TROUVER LES COORDONN...
GETCOLOR BOITE DE DIALOGUE COULEUR
FRANCISATION DE BEAUCOUP DE MESSAGE ISSUE DU SERVEUR IRC

 Sources de la même categorie

Source avec Zip PENDU POUR MIRC par neobidou
Source avec Zip MODIFICATION ET TRADUCTION DU SCRIPT RHYTHMBOX XCHAT ANNOUNC... par TrHiLK1L
[TCL] AUTOJOIN DE ROBOT AUTOMATIQUE par Atok
Source avec une capture TORRENT VIEWER par kamikaze97441
Source avec Zip Source avec une capture PANNEAU DE CONFIGURATION PS7 par aliassangelius

Commentaires et avis

Commentaire de dj328i le 17/11/2003 09:28:26

Ouais c'est super bien :) mais dommage que le script ne soie valide que pour la france

Commentaire de Kolibot le 17/11/2003 09:30:19

L'intêret du script est sympa. Cela peut être utile parfois de connaître les coordonnées de sa ville. Au cas où l'on bosse sur un lancement de bombe nucléaire sur un objectif précis lol. Je déconne. Cette fois c'est pas trop mal scripté... malgrès quelques petites choses tel que :
    /unset %bot-GPS.OQP
    /unset %bot-GPS.city
    /unset %bot-GPS.ZIP
    /unset %bot-GPS.NS
    /unset %bot-GPS.EO
    /unset %bot-GPS.critere
    /unset %Bot-Gps.temp
    /unset %temp
Que tu pourrais remplacer par :
unset   %bot-GPS.OQP %bot-GPS.city %bot-GPS.ZIP %bot-GPS.NS %bot-GPS.EO %bot-GPS.critere %Bot-Gps.temp %temp

Autre chose que je ne comprend pas parfois tu écris : %x = y et parfois Set %x y il est clair que la première syntaxe est beaucoup plus courte... Autre chose %x == $null &lt;=&gt; !%x et cela marche aussi pour les identifieurs : $x == $null &lt;=&gt; !$x

Autre chose un petit dialog n'aurait fait de mal à personne...

Commentaire de taye78 le 18/11/2003 04:15:12

salut,
tips: /unset %bot-GPS.* %temp


wG &lt;wg@coding.tk&gt;

Commentaire de nestor_chat le 18/11/2003 07:32:18

pas mal ca taye78 ....
merci

Commentaire de Philou150456 le 30/08/2004 16:26:56

y trouve jamais rien meme je tape un truc dans Paris et ca le trouve pas ! on peut mexpliquer ?

Commentaire de urtooslow le 16/05/2005 21:02:46

tinquiete pas chez moi non plus ca trouve rien :D

Commentaire de Moitorche le 05/01/2010 17:50:25

Jai copier exactement ta remote je mets /GPS 13008
Il me mets GPS commande non-trouvé !

Commentaire de Moitorche le 05/01/2010 17:54:32

Ca y est j'ai trouvé mon problème !
Maintenant j'en ai un autre , je mets /GPS Paris et il me mets ça :
[17:53:37] - Module GPS By Nestor - Un instant je cherche les informations sur Paris...
[17:53:37] - Je ne trouve rien dans ma base sur Paris.
[17:53:37] - Changer votre critere.
[17:53:37] - C'est tout pour aujourd'hui.

Pourquoi ?

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,123 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales