|
Trouver une ressource
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
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
Sources de la même categorie
Commentaires et avis
|
|