Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 20/06/2009, à 10:52

hurley

Activation d'un bouton

Bonjour (je sais, 5 ou 6ème sujet en une semaine....), je sais pas si je post au bon endroit...
Je suis en train d'écrire un script qui me rendra la vie plus simple sur un jeu internet.
Grâce à la communauté, j'ai compris comment me connecter avec wget, récupérer un code source avec wget, trouver une ligne, copier la ligne, extraire un prix. Je ne suis pas peu fier d'avoir réussi à écrire tout seul et comme un grand heu.... les commentaires dans le script smile.... maintenant, l'étape ultime, il me faut court circuiter le "clique sur bouton acheter" pour acheter. Mais il faut préciser qu'il y a 30 boutons 'acheter' et que je ne comprends déjà pas comment ils sont distingués....


<table width="650" border="0" align="center">
          <tr>
            <td>                <table width="300" height="135" border="0" class="Style5" style="background-color:#EFEFEF;border:1px dashed; border-color:#CCCCCC; float:left; margin-right:10px; margin-bottom:10px" cellpadding="0" cellspacing="0" onMouseover="style.backgroundColor='#e9e9e9';style.borderColor='black'" onMouseout="style.backgroundColor='#EFEFEF';style.borderColor='#CCCCCC'">
                  <tr>
                    <td width="120"><img src="../images/vehicules/VL.jpg" alt="VL"
                        width="120" height="90"                        ></td>

                    <td width="170" align="left" valign="middle" ><form name="form2" method="post" action="" onsubmit="return confirm('Es-tu sûr de vouloir acheter ce VL pour 1600 Fz ?')">
                        <label>
                        <strong>VL</strong> -
                        Véhicule Léger                        <br>
                        0 interventions <br>
                        Etat : Equipé<br>
                        Proprio: <strong>

                        tarlexfire                        </strong><br>
                        <span class="Style3">Prix : 1600 Fz </span>&nbsp;&nbsp;
                        <input name="Submit2" type="submit" class="Style7" value="Acheter" >
                        <input name="prix" type="hidden" id="prix" value="1600">
                        </label>
                        <input name="vehid" type="hidden" id="vehid" value="667941">
                        <input name="proprio" type="hidden" id="proprio" value="108836">
                                        </form></td>

                  </tr>
                </table>
                              <table width="300" height="135" border="0" class="Style5" style="background-color:#EFEFEF;border:1px dashed; border-color:#CCCCCC; float:left; margin-right:10px; margin-bottom:10px" cellpadding="0" cellspacing="0" onMouseover="style.backgroundColor='#e9e9e9';style.borderColor='black'" onMouseout="style.backgroundColor='#EFEFEF';style.borderColor='#CCCCCC'">
                  <tr>
                    <td width="120"><img src="../images/vehicules/VL.jpg" alt="VL"
                        width="120" height="90"                        ></td>
                    <td width="170" align="left" valign="middle" ><form name="form2" method="post" action="" onsubmit="return confirm('Es-tu sûr de vouloir acheter ce VL pour 1600 Fz ?')">
                        <label>
                        <strong>VL</strong> -
                        Véhicule Léger                        <br>

                        1 interventions <br>
                        Etat : Equipé<br>
                        Proprio: <strong>
                        tarlexfire                        </strong><br>
                        <span class="Style3">Prix : 1600 Fz </span>&nbsp;&nbsp;
                        <input name="Submit2" type="submit" class="Style7" value="Acheter" >

                        <input name="prix" type="hidden" id="prix" value="1600">
                        </label>
                        <input name="vehid" type="hidden" id="vehid" value="738269">
                        <input name="proprio" type="hidden" id="proprio" value="108836">
                                        </form></td>
                  </tr>
                </table>
                              <table width="300" height="135" border="0" class="Style5" style="background-color:#EFEFEF;border:1px dashed; border-color:#CCCCCC; float:left; margin-right:10px; margin-bottom:10px" cellpadding="0" cellspacing="0" onMouseover="style.backgroundColor='#e9e9e9';style.borderColor='black'" onMouseout="style.backgroundColor='#EFEFEF';style.borderColor='#CCCCCC'">
                  <tr>

                    <td width="120"><img src="../images/vehicules/VL.jpg" alt="VL"
                        width="120" height="90"                        ></td>
                    <td width="170" align="left" valign="middle" ><form name="form2" method="post" action="" onsubmit="return confirm('Es-tu sûr de vouloir acheter ce VL pour 1700 Fz ?')">
                        <label>
                        <strong>VL</strong> -
                        Véhicule Léger                        <br>
                        19 interventions <br>
                        Etat : Non équipé<br>

                        Proprio: <strong>
                        marie71                        </strong><br>
                        <span class="Style3">Prix : 1700 Fz </span>&nbsp;&nbsp;
                        <input name="Submit2" type="submit" class="Style7" value="Acheter" >
                        <input name="prix" type="hidden" id="prix" value="1700">
                        </label>
                        <input name="vehid" type="hidden" id="vehid" value="326074">

                        <input name="proprio" type="hidden" id="proprio" value="55806">
                                        </form></td>
                  </tr>
                </table>
### j'ai supprimé 27 autres objets en vente parce qu'il me semble que c'est pareil ###
              </td>
          </tr>
        </table>
        <br>
        <table width="229" border="0">

          <tr>
            <td align="center"> </td>
            <td align="center"></td>
            <td align="center">                  <a href="/fr/game/index.php?p=sell&pageNum_rsVente=1&order=prix"><img src="../images/icons/next.png" alt="Suivant"></a>
            </td>
            <td align="center">                  <a href="/fr/game/index.php?p=sell&pageNum_rsVente=5&order=prix"><img src="../images/icons/arrow_undo.png" alt="Dernière Page"></a>
             </td>

          </tr>
        </table>
        <div align="left"><br />
            <span class="Style8"><em>[?] Modifier un prix ? il suffit de s&eacute;l&eacute;ctionner le v&eacute;hicule que vous voulez et de faire comme si vous voulez le &quot;revendre&quot; le changement de prix se fera tout seul</em>        <br />
        [?] Supprimer une annonce ? Les annonces que vous avez mise ont une petite croix rouge sur le cot&eacute;, cliquez dessus et l'annonce sera supprim&eacute;e </span></div>
       
      </td>
  </tr>
</table>
<BR /></TD>
<TD rowspan="2" width="31" height="262" class="c21" valign="top"><IMG src="../images/graph_22.jpg" width="31" height="262" alt="" /></TD>
</TR>
<TR>
<TD width="752" height="21" colspan="8" bgcolor="#EFEFEF"> </TD>
</TR>
<TR>
<TD width="30" height="13" class="c22"></TD>
<TD colspan="8" width="752" height="13" class="c23"></TD>
<TD width="31" height="13" class="c24"></TD>
</TR>

</TABLE>
<DIV class="Style1 c1">
<div class="Style1" align="center">
  <p>
    <script type="text/javascript"><!--
google_ad_client = "pub-0739688616970103";
/* footer2 */
google_ad_slot = "4284885460";
google_ad_width = 728;
google_ad_height = 90;
//-->
  </script>
    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
    <br />

  <table width="880" border="0" class="Style8">
  <tr>
    <td align="center">

</td>
    </tr>
  <tr>
    <td align="center" class="Style2bis">
<a href="http://www.xiti.com/xiti.asp?s=354061" title="WebAnalytics">
<script type="text/javascript">
<!--
Xt_param = 's=354061&p=sell';
try {Xt_r = top.document.referrer;}
catch(e) {Xt_r = document.referrer; }
Xt_h = new Date();
Xt_i = '<img width="80" height="15" border="0" alt="" ';
Xt_i += 'src="http://logv145.xiti.com/orcr.xiti?'+Xt_param;
Xt_i += '&hl='+Xt_h.getHours()+'x'+Xt_h.getMinutes()+'x'+Xt_h.getSeconds();
if(parseFloat(navigator.appVersion)>=4)
{Xt_s=screen;Xt_i+='&r='+Xt_s.width+'x'+Xt_s.height+'x'+Xt_s.pixelDepth+'x'+Xt_s.colorDepth;}
document.write(Xt_i+'&ref='+Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$')+'" title="Internet Audience">');
//-->
</script>
<noscript>
<img width="80" height="15" src="http://logv145.xiti.com/orcr.xiti?s=354061&p=sell" alt="WebAnalytics" /></noscript></a></td>
  </tr>
</table>

</div>
</DIV>
<DIV id="bulle"></DIV>
</BODY>
</HTML>

donc si on s'intéresse au premier item, il me semble que

<td>                <table width="300" height="135" border="0" class="Style5" style="background-color:#EFEFEF;border:1px dashed; border-color:#CCCCCC; float:left; margin-right:10px; margin-bottom:10px" cellpadding="0" cellspacing="0" onMouseover="style.backgroundColor='#e9e9e9';style.borderColor='black'" onMouseout="style.backgroundColor='#EFEFEF';style.borderColor='#CCCCCC'">

sert à changer les couleurs quand on passe la souris sur le rectangle défini

<tr>

je sais pas à quoi il sert

<td width="120"><img src="../images/vehicules/VL.jpg" alt="VL"
                        width="120" height="90"                        ></td>

affiche l'image de l'item

<td width="170" align="left" valign="middle" ><form name="form2" method="post" action="" onsubmit="return confirm('Es-tu sûr de vouloir acheter ce VL pour 1600 Fz ?')">

c'est une fenêtre qui apparait quand on clique sur acheter, et ensuite faut cliquer sur Ok pour valider l'achat

<label>
                        <strong>VL</strong> -
                        Véhicule Léger                        <br>
                        0 interventions <br>
                        Etat : Equipé<br>
                        Proprio: <strong>

                        tarlexfire                        </strong><br>
                        <span class="Style3">Prix : 1600 Fz </span>&nbsp;&nbsp;
                        <input name="Submit2" type="submit" class="Style7" value="Acheter" >

tout ça on y voit dans le rectangle affecté à l'item

<input name="prix" type="hidden" id="prix" value="1600">
                        </label>
                        <input name="vehid" type="hidden" id="vehid" value="667941">
                        <input name="proprio" type="hidden" id="proprio" value="108836">
                                        </form></td>

                  </tr>
                </table>

et tout ça, on le voit pas.... c'est ce qui me semble être "la boîte noire" que je n'arrive pas à décortiquer...
quelqu'un a-t-il eu le courage de lire jusqu'au? et a-t-il en plus des infos à partager?
merci

Dernière modification par hurley (Le 20/06/2009, à 11:11)


HP Pavilion dv6-1160 - Ubuntu 10.04 LTS "The Lucid Lynx"
"Windows sert à avoir IE; IE sert à télécharger firefox; Firefox sert à télécharger linux"

Hors ligne