Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum. Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

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


Information sur la source

Catégorie :Scripts Niveau : Initié Date de création : 17/11/2003 Date de mise à jour : 18/11/2003 17:42:29 Vu : 35 154

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

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10

Commentaire sur cette source (6)
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.


 

Commentaires et avis

signaler à un administrateur
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

signaler à un administrateur
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...

signaler à un administrateur
Commentaire de taye78 le 18/11/2003 04:15:12

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


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

signaler à un administrateur
Commentaire de nestor_chat le 18/11/2003 07:32:18

pas mal ca taye78 ....
merci

signaler à un administrateur
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 ?

signaler à un administrateur
Commentaire de urtooslow le 16/05/2005 21:02:46

tinquiete pas chez moi non plus ca trouve rien :D

Ajouter un commentaire



Nos sponsors

Sondage...

CalendriCode

Octobre 2008
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
2728293031  

Consulter la suite du CalendriCode



Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel BAÏSE, 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
Temps d'éxécution de la page : 0,34 sec

Google Coop CodeS-SourceS Google Coop CodeS-SourceS


Certaines images présentes sur le site (notament certains avatars) sont issues des collections IconShock, donc si vous souhaitez utiliser ces icons vous devez les acheter, ne les copiez pas et ne utilisez pas dans vos sites et applications sans les avoir commandé.