Aller au contenu
  • 0

Problème pour récupérer un motd.


Question

Posté(e)

Bonjour,

Ayant regarder sur de nombreuses discussions la méthode pour importer un motd d'un serveur sur une variable d'un autre serveur, j'ai donc utiliser la méthode par un API. Après avoir créé une page php avec le code pour récupérer le motd de mon serveur (cela marche , http://sheep-world.livehost.fr/motd.php ). Je décide donc de récupérer le texte issus de cette page avec le code suivant.

command /test:
   trigger:
       set {_t} to text from "http://sheep-world.livehost.fr/motd.php"
       wait 1 tick
       send "%{_t}%"

 

Aucunes erreur mais malheureusement, la variable reste "none". Donc si quelqu'un a vu où je me suis tromper, je le remercie d'avance..

PS: Désolé si je me suis trompé de section ...

17 réponses à cette question

Messages recommandés

  • 0
Posté(e)

Normalement la variable sera la suivante:

<FONT COLOR="55FF55">Waiting </FONT>
<script></script><!-- "-->
<style>
#foot8b7ea{
background:none;
position: fixed;
width: 100%;
left: 0px;
bottom: 0px;
padding:0;
margin:0;
z-index:1000000000;
display:none;
height:125px !important;
}
body{
//margin-bottom:100px;
}
div a.closelh8b7ea{
text-align:center;
background-color:rgba(0,0,0,0.7);
color:#FFF;
display:block;
padding:0;
margin:0;
font-family:tahoma;
font-size:12px;
border-radius:2px;
text-decoration:none;
font-weight:bold;
line-height:25px;
}
a.closelh8b7ea:hover{
background-color:#0044AA;
}
div.notelh874{
font-family:Arial;
background-color:rgba(0,0,0,0.4);
//background-color:#08f;
color:#fff;
font-size:14px;
text-align:left;
padding-left:10px;
line-height:16px;
font-weight:normal;
}
</style>
<script> document.write('<style>#foot8b7ea{ display:block; }</style>');</script>
<div id="foot8b7ea">
<center>
<div style="margin:0px;padding:0px 0px;width:728px;background-color:rgba(0,0,0,0.0);">
<div style="margin:0 0 0px 0;height:134px;width:100%;">
<center>
<div style="width:728px;margin:0 auto;">
<a style="margin-bottom:5px;width:228px;" class="closelh8b7ea" href="http://ads.clicmanager.fr/exe.php?c=43793&s=60342&t=6&q="></script>
</div>
<!--<div style="float:left;width:272px;">
<a class="closelh8b7ea" href="javascript:closepub_lh8b7ea();">Fermer cette publicité</a>
<div class="notelh874">
Note au webmaster :<br/>
1 Code starpass = 45 jours sans pub sur vos sites !<br/>C'est ici ><a target="blank" href="http://www.livehost.fr/moncompte.php?action=pub"><u style="color:#fff;">Mon compte livehost.fr</u></a>.
</div>
<div>-->
<div style="clear:both;padding:0;margin:0"></div>
</div>
</center>
</div>
</div>
</center>
</div>
<div id="foot28b7ea" style="height:125px;padding:0;margin:0;"></div>
<script type='text/javascript'>
if(window.location!=top.location){
document.getElementById('foot8b7ea').style.display='none';
document.getElementById('foot28b7ea').style.display='none';
}
function closepub_lh8b7ea(){
document.getElementById('foot8b7ea').style.display='none';
document.getElementById('foot28b7ea').style.display='none';
createCookielh8b7ea('no_pub_lh8b7ea','true',5);
}
function createCookielh8b7ea(name,value,minutes) { if (minutes) { var date = new Date();date.setTime(date.getTime()+(minutes*60*1000));var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; }
</script>
<script>
function lhcreateCookielh8b7ea(name,value,minutes) { if (minutes) { var date = new Date();date.setTime(date.getTime()+(minutes*60*1000));var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; }
lhcreateCookielh8b7ea('phpbb3_lh8b7ea','1',10000);
</script>

Donc ce ne sera pas bon. Un "text from" récupère le code source de la page, pas le texte afiché.

J'ai une solution mais donne moi toutes les possibiltées de MOTD.

Et passe l'ip et le port de ton serveur, je croit avoir une solution.

  • 0
Posté(e)
Normalement la variable sera la suivante:

<FONT COLOR="55FF55">Waiting </FONT>
<script></script><!-- "-->
<style>
#foot8b7ea{
background:none;
position: fixed;
width: 100%;
left: 0px;
bottom: 0px;
padding:0;
margin:0;
z-index:1000000000;
display:none;
height:125px !important;
}
body{
//margin-bottom:100px;
}
div a.closelh8b7ea{
text-align:center;
background-color:rgba(0,0,0,0.7);
color:#FFF;
display:block;
padding:0;
margin:0;
font-family:tahoma;
font-size:12px;
border-radius:2px;
text-decoration:none;
font-weight:bold;
line-height:25px;
}
a.closelh8b7ea:hover{
background-color:#0044AA;
}
div.notelh874{
font-family:Arial;
background-color:rgba(0,0,0,0.4);
//background-color:#08f;
color:#fff;
font-size:14px;
text-align:left;
padding-left:10px;
line-height:16px;
font-weight:normal;
}
</style>
<script> document.write('<style>#foot8b7ea{ display:block; }</style>');</script>
<div id="foot8b7ea">
<center>
<div style="margin:0px;padding:0px 0px;width:728px;background-color:rgba(0,0,0,0.0);">
<div style="margin:0 0 0px 0;height:134px;width:100%;">
<center>
<div style="width:728px;margin:0 auto;">
<a style="margin-bottom:5px;width:228px;" class="closelh8b7ea" href="http://ads.clicmanager.fr/exe.php?c=43793&s=60342&t=6&q="></script>
</div>
<!--<div style="float:left;width:272px;">
<a class="closelh8b7ea" href="javascript:closepub_lh8b7ea();">Fermer cette publicité</a>
<div class="notelh874">
Note au webmaster :<br/>
1 Code starpass = 45 jours sans pub sur vos sites !<br/>C'est ici ><a target="blank" href="http://www.livehost.fr/moncompte.php?action=pub"><u style="color:#fff;">Mon compte livehost.fr</u></a>.
</div>
<div>-->
<div style="clear:both;padding:0;margin:0"></div>
</div>
</center>
</div>
</div>
</center>
</div>
<div id="foot28b7ea" style="height:125px;padding:0;margin:0;"></div>
<script type='text/javascript'>
if(window.location!=top.location){
document.getElementById('foot8b7ea').style.display='none';
document.getElementById('foot28b7ea').style.display='none';
}
function closepub_lh8b7ea(){
document.getElementById('foot8b7ea').style.display='none';
document.getElementById('foot28b7ea').style.display='none';
createCookielh8b7ea('no_pub_lh8b7ea','true',5);
}
function createCookielh8b7ea(name,value,minutes) { if (minutes) { var date = new Date();date.setTime(date.getTime()+(minutes*60*1000));var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; }
</script>
<script>
function lhcreateCookielh8b7ea(name,value,minutes) { if (minutes) { var date = new Date();date.setTime(date.getTime()+(minutes*60*1000));var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; }
lhcreateCookielh8b7ea('phpbb3_lh8b7ea','1',10000);
</script>

Donc ce ne sera pas bon. Un "text from" récupère le code source de la page, pas le texte afiché.

J'ai une solution mais donne moi toutes les possibiltées de MOTD.

Le "text from" récupère ce qui est affiché sur la page. Non pas son code source :)

  • 0
Posté(e)

options:
   ip: 51.254.11.100
   port: 25580
command /test:
   trigger:
       set {_motd} to text from "http://api.serveurs-minecraft.com/api.php?Motd_Ping&ip={@ip}&port={port}"
       if {_motd} contains "En cours":
           set {_motd} to "&4✖ &cEn cours &4✖"
       else if {_motd} contains "Waiting":
           set {_motd} to "&aWaiting"
       else if {_motd} contains "Fin":
           set {_motd} to "&6≡ &eFin &6≡"
       else if {_motd} contains "Redémarage":
           set {_motd} to "&5⚠ &dRedémarage &5⚠"
      wait 1 ticks
      message "%{_motd}%"

Voilà

 

Un j'aime, ça fait plaisir ;)
  • J'aime 1
×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.