Sign in to follow this  
Followers 0
Clyde

Trying to click link

9 posts in this topic

#1 ·  Posted (edited)

Hello everybody,

I'm fairly new to Autoit and I'm working on one of my first scripts. It's a script to use with a web page. I would like to run it on more than one computer so I would like to use only _IE functions. That way I'm sure I won't run in to any problems when running it elsewhere. My specific problem is the following: I want to click a link on a website but it doesn't work with _IELinkClickByIndex or _IELinkClickByText. I've been searching this forum and the autoit help file for hours but I can't seem to find anything there that can help me. I did use the debugbar and I think I know what the problem is. This is the link I want to click:

<A onmouseup=add_res(1); onclick="return false;" href="#">(1250)</A>

As you can see it goes in to action when you use mouseup and not when you click it. I've no problems clicking on other links on the site. I guess I could try to click it by using the text "1250". My only problem is, this text changes al the time so then I would have to change my script all the time. Has anyone any idea how to click this link so it goes in to action?

I have the code of my script (which isn't very interesting;) ) and of the site and I've made the link I would like to click fat. If you need any more information I will be glad to give it right away.

Greetings, Clyde

#include <IE.au3>
$oIE = _IECreate ("http://s2.travian.nl/login.php")
Sleep (5000)
$Login = _IEGetObjByName ($oIE, "s2")
_IEAction ($Login, "click")
_IELoadWait ($oIE)
_IENavigate ($oIE, "http://s2.travian.nl/build.php?newdid=90602&gid=17&id=35")
_IELoadWait ($oIE)
_IELinkClickByText ( $oIE, "1250", "0")
Sleep (5000)

CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"

"http://www.w3.org/TR/html4/strict.dtd"><html>

<head>

<title>Travian nl1</title>

<link rel=stylesheet type="text/css" href="new.css?w">

<link rel=stylesheet type="text/css" href="unx.css">

<script src="unx.js?w" type="text/javascript"></script>

<meta http-equiv="cache-control" content="max-age=0">

<meta http-equiv="pragma" content="no-cache">

<meta http-equiv="expires" content="0">

<meta http-equiv="imagetoolbar" content="no">

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

</head>

<body onload="start()"><div id="ltop1"><div id="ltop5"><a href="dorf1.php"><img id="n1" src="img/un/a/x.gif" title="Overzicht van het dorp"></a><a href="dorf2.php"><img id="n2" src="img/un/a/x.gif" title="Centrum van het dorp"></a><a href="karte.php"><img id="n3" src="img/un/a/x.gif" title="Kaart"></a><a href="statistiken.php"><img id="n4" src="img/un/a/x.gif" title="Statistieken"></a><img id="n5" src="img/un/l/m2.gif" usemap="#nb"><a href="plus.php"><img id="lplus1" src="img/nl/a/plus.gif" width="80" height="100" title="Plus Menu"></a></div></div><map name="nb"><area shape=rect coords="0,0,35,100" href="berichte.php" title="Rapportages"><area shape=rect coords="35,0,70,100" href="nachrichten.php" title="Berichten"></map><div id="lmidall"><div id="lmidlc"><div id="lleft">

<a href="http://www.travian.nl/"><img class="logo" src="img/nl/a/travian1.gif"></a><div style="position:absolute; left:110px; top:-5px; z-index:999; color:#FF8000; font-size:18pt;"><span title="Vrede:

24.12.08 12:00 -

27.12.08 00:00">♥</span></div><table id="navi_table" cellspacing="0" cellpadding="0">

<tr>

<td class="menu">

<a href="http://www.travian.nl/">Home</a>

<a href="#" onclick="return Popup(0,0);">Instructies</a>

<a href="spieler.php?uid=706">Profiel</a><a href="logout.php">Log uit</a><br><br><a href="http://forum.travian.nl/" target="_blank">Forum</a><a href="http://www.travian.nl/chat/?chatname=nl1|706" target="_blank">Chat</a><br><br><a href="plus.php?id=3">Travian <b><font color="#71D000">P</font><font color="#FF6F0F">l</font><font color="#71D000">u</font><font color="#FF6F0F">s</font></b></a><a href="support.php">Support</a></td>

</tr>

</table></div><div id="lmid1"><div id="lmid2"><h1><b>Marktplaats Niveau 20</b></h1>

<p class="f10">Op de Marktplaats kan er gehandeld worden met andere spelers. Per niveau van de Marktplaats is er één handelaar beschikbaar.</p><p class="txt_menue">

<a href="build.php?id=33">Stuur grondstoffen</a> |

<a href="build.php?id=33&t=1">Kopen</a> |

<a href="build.php?id=33&t=2">Verkopen</a> | <a href="build.php?id=33&t=3">NPC Handel</a></p><script language="Javascript">

<!--

var dorfnamen = new Array("[01]Bienville Parish","[02]Ellis County","[03]Runnels County","[04]West Dallas");

//-->

</script><script language="Javascript">

<!--

var haendler = 5;

var carry = 1000;

//-->

</script><p>

<form method="POST" name="snd" action="build.php">

<input type="hidden" name="id" value="33">

<table cellspacing="0" cellpadding="0" width="100%" valign="top">

<tr valign="top">

<td width="45%">

<table class="f10">

<tr>

<td><a href="#" onclick="upd_res(1,1); return false;"><img class="res" src="img/un/r/1.gif"></a></td>

<td>Hout:</td><td align="right"><input class="fm" type="Text" name="r1" id="r1" value="" size="4" maxlength="5" onkeyup="upd_res(1)" tabindex="1"></td><td class="s7 f8"><a href="#" onmouseup="add_res(1);" onclick="return false;">(1000)</a></td>

</tr>

<tr>

<td><a href="#" onclick="upd_res(2,1); return false;"><img class="res" src="img/un/r/2.gif"></a></td>

<td>Klei:</td><td align="right"><input class="fm" type="Text" name="r2" id="r2" value="" size="4" maxlength="5" onkeyup="upd_res(2)" tabindex="2"></td><td class="s7 f8"><a href="#" onmouseup="add_res(2);" onclick="return false;">(1000)</a></td>

</tr>

<tr>

<td><a href="#" onclick="upd_res(3,1); return false;"><img class="res" src="img/un/r/3.gif"></a></td>

<td>IJzer:</td><td align="right"><input class="fm" type="Text" name="r3" id="r3" value="" size="4" maxlength="5" onkeyup="upd_res(3)" tabindex="3"></td><td class="s7 f8"><a href="#" onmouseup="add_res(3);" onclick="return false;">(1000)</a></td>

</tr>

<tr>

<td><a href="#" onclick="upd_res(4,1); return false;"><img class="res" src="img/un/r/4.gif"></a></td>

<td>Graan:</td><td align="right"><input class="fm" type="Text" name="r4" id="r4" value="" size="4" maxlength="5" onkeyup="upd_res(4)" tabindex="4"></td><td class="s7 f8"><a href="#" onmouseup="add_res(4);" onclick="return false;">(1000)</a></td>

</tr>

</table>

</td><td width="55%" valign="top">

<table class="f10">

<tr><td colspan="2">Handelaren 5/20<br><br></td></tr>

<tr><td colspan="2"><span class="f135 b">Dorp:</span>

<input class="fm" type="Text" name="dname" value="" size="10" maxlength="20" tabindex="5" onkeyup="my_village()"></td>

</tr>

<tr><td colspan="2"><i>of</i></td></tr>

<tr>

<td colspan="2">

<span class="f135 b">

X:

<input class="fm" type="Text" name="x" value="" size="2" maxlength="4" tabindex="6">

Y:

<input class="fm" type="Text" name="y" value="" size="2" maxlength="4" tabindex="7">

</span></td>

</tr>

</table>

</td></tr>

</table><p><input type="Checkbox" name="x2" value="1" tabindex="9"> Opgegeven grondstoffen twee keer versturen</p><p><input type="image" value="ok" border="0" name="s1" src="img/nl/b/ok1.gif" width="50" height="20" onmousedown="btm1('s1','','img/nl/b/ok2.gif',1)" onmouseover="btm1('s1','','img/nl/b/ok3.gif',1)" onmouseup="btm0()" onmouseout="btm0()" tabindex="9"></input></form></p><script language="Javascript" type="text/javascript">

//<!--

document.snd.r1.focus();

//-->

</script><p>Elke handelaar kan <b>1000</b> grondstoffen dragen.</p><p class="b">Aankomende handelaren:</p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=1140"><span class="c0">misterlin</span></a></td>

<td colspan="2"><a href="karte.php?d=314358&c=dc"><span class="c0">Transport van ola2</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer1>0:31:15</span> uur</td><td>om 15:23 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">1500 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">0</td></tr></table></p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=1140"><span class="c0">misterlin</span></a></td>

<td colspan="2"><a href="karte.php?d=314357&c=54"><span class="c0">Transport van ola3</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer2>0:32:26</span> uur</td><td>om 15:24 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">1500 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">0</td></tr></table></p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=1140"><span class="c0">misterlin</span></a></td>

<td colspan="2"><a href="karte.php?d=314357&c=54"><span class="c0">Transport van ola3</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer3>0:32:32</span> uur</td><td>om 15:24 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">1500 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">0</td></tr></table></p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=1140"><span class="c0">misterlin</span></a></td>

<td colspan="2"><a href="karte.php?d=314357&c=54"><span class="c0">Transport van ola3</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer4>0:32:51</span> uur</td><td>om 15:24 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">1500 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">0</td></tr></table></p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=1140"><span class="c0">misterlin</span></a></td>

<td colspan="2"><a href="karte.php?d=314357&c=54"><span class="c0">Transport van ola3</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer5>0:33:01</span> uur</td><td>om 15:24 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">1500 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">0</td></tr></table></p><p class="b">Eigen handelaren onderweg:</p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=706"><span class="c0">Bonnie & Clyde</span></a></td>

<td colspan="2"><a href="karte.php?d=314358&c=dc"><span class="c0">Transport naar ola2</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer6>1:51:46</span> uur</td><td>om 16:43 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">0 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">3000</td></tr></table></p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=706"><span class="c0">Bonnie & Clyde</span></a></td>

<td colspan="2"><a href="karte.php?d=314357&c=54"><span class="c0">Transport naar ola3</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer7>1:54:04</span> uur</td><td>om 16:45 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">0 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">3000</td></tr></table></p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=706"><span class="c0">Bonnie & Clyde</span></a></td>

<td colspan="2"><a href="karte.php?d=314357&c=54"><span class="c0">Transport naar ola3</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer8>1:54:10</span> uur</td><td>om 16:45 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">0 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">3000</td></tr></table></p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=706"><span class="c0">Bonnie & Clyde</span></a></td>

<td colspan="2"><a href="karte.php?d=314357&c=54"><span class="c0">Transport naar ola3</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer9>1:54:29</span> uur</td><td>om 16:46 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">0 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">3000</td></tr></table></p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=706"><span class="c0">Bonnie & Clyde</span></a></td>

<td colspan="2"><a href="karte.php?d=314357&c=54"><span class="c0">Transport naar ola3</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer10>1:54:39</span> uur</td><td>om 16:46 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">0 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">3000</td></tr></table></p><p class="c">Marktplaats is volledig uitgebouwd</p><img src="img/un/a/x.gif" /></div></div></div><div id="lright1"><a href="dorf3.php"><span class="f10 c0 s7 b">Dorpen:</span></a><table class="f10"><tr><td class="nbr"><span class="c2"></span>&nbsp; <a href="?newdid=852&gid=17&id=33" class="active_vl">LouisianaHighway 154</a></td><td class="right"><table class="dtbl" cellspacing="0" cellpadding="0">

<tr>

<td class="right dlist1">(-21</td>

<td class="center dlist2">|</td>

<td class="left dlist3">-21)</td>

</tr>

</table></td></tr><tr><td class="nbr"><span></span>&nbsp; <a href="?newdid=18151&gid=17&id=33">[01]Bienville Parish</a></td><td class="right"><table class="dtbl" cellspacing="0" cellpadding="0">

<tr>

<td class="right dlist1">(-19</td>

<td class="center dlist2">|</td>

<td class="left dlist3">-21)</td>

</tr>

</table></td></tr><tr><td class="nbr"><span></span>&nbsp; <a href="?newdid=24442&gid=17&id=33">[02]Ellis County</a></td><td class="right"><table class="dtbl" cellspacing="0" cellpadding="0">

<tr>

<td class="right dlist1">(-20</td>

<td class="center dlist2">|</td>

<td class="left dlist3">-23)</td>

</tr>

</table></td></tr><tr><td class="nbr"><span></span>&nbsp; <a href="?newdid=29760&gid=17&id=33">[03]Runnels County</a></td><td class="right"><table class="dtbl" cellspacing="0" cellpadding="0">

<tr>

<td class="right dlist1">(-19</td>

<td class="center dlist2">|</td>

<td class="left dlist3">-20)</td>

</tr>

</table></td></tr><tr><td class="nbr"><span></span>&nbsp; <a href="?newdid=35010&gid=17&id=33">[04]West Dallas</a></td><td class="right"><table class="dtbl" cellspacing="0" cellpadding="0">

<tr>

<td class="right dlist1">(-21</td>

<td class="center dlist2">|</td>

<td class="left dlist3">-22)</td>

</tr>

</table></td></tr></table><ul class="dl"></ul></div></div><div id="lres0">

<table align="center" cellspacing="0" cellpadding="0"><tr valign="top">

<td><img class="res" src="img/un/r/1.gif" title="Hout"></td>

<td id=l4 title=1000>16315/80000</td>

<td class="s7"> <img class="res" src="img/un/r/2.gif" title="Klei"></td>

<td id=l3 title=1100>16818/80000</td>

<td class="s7"> <img class="res" src="img/un/r/3.gif" title="IJzer"></td>

<td id=l2 title=1000>22057/80000</td><td class="s7"> <img class="res" src="img/un/r/4.gif" title="Graan"></td>

<td id=l1 title=1789>62357/80000</td>

<td class="s7"> &nbsp;<img class="res" src="img/un/r/5.gif" title="Graanverbruik">&nbsp;790/2579</td></tr></table>

</div><div id="ltime">Berekening in <b>13</b> ms<br>Servertijd: <span id="tp1" class="b">14:51:46</span> </div>

<div id="ce"></div></body>

</html>

Edited by Clyde

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

@Clyde

Please use code for your scripts :

"autoit" "code"

#include <IE.au3>
$oIE = _IECreate ("http://s2.travian.nl/login.php")
Sleep (5000)
$Login = _IEGetObjByName ($oIE, "s2")
_IEAction ($Login, "click")
_IELoadWait ($oIE)
_IENavigate ($oIE, "http://s2.travian.nl/build.php?newdid=90602&gid=17&id=35")
_IELoadWait ($oIE)
_IELinkClickByText ( $oIE, "1250", "0")
Sleep (5000)

CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"

"http://www.w3.org/TR/html4/strict.dtd"><html>

<head>

<title>Travian nl1</title>

<link rel=stylesheet type="text/css" href="new.css?w">

<link rel=stylesheet type="text/css" href="unx.css">

<script src="unx.js?w" type="text/javascript"></script>

<meta http-equiv="cache-control" content="max-age=0">

<meta http-equiv="pragma" content="no-cache">

<meta http-equiv="expires" content="0">

<meta http-equiv="imagetoolbar" content="no">

<meta http-equiv="content-type" content="text/html; charset=UTF-8">

</head>

<body onload="start()"><div id="ltop1"><div id="ltop5"><a href="dorf1.php"><img id="n1" src="img/un/a/x.gif" title="Overzicht van het dorp"></a><a href="dorf2.php"><img id="n2" src="img/un/a/x.gif" title="Centrum van het dorp"></a><a href="karte.php"><img id="n3" src="img/un/a/x.gif" title="Kaart"></a><a href="statistiken.php"><img id="n4" src="img/un/a/x.gif" title="Statistieken"></a><img id="n5" src="img/un/l/m2.gif" usemap="#nb"><a href="plus.php"><img id="lplus1" src="img/nl/a/plus.gif" width="80" height="100" title="Plus Menu"></a></div></div><map name="nb"><area shape=rect coords="0,0,35,100" href="berichte.php" title="Rapportages"><area shape=rect coords="35,0,70,100" href="nachrichten.php" title="Berichten"></map><div id="lmidall"><div id="lmidlc"><div id="lleft">

<a href="http://www.travian.nl/"><img class="logo" src="img/nl/a/travian1.gif"></a><div style="position:absolute; left:110px; top:-5px; z-index:999; color:#FF8000; font-size:18pt;"><span title="Vrede:

24.12.08 12:00 -

27.12.08 00:00">♥</span></div><table id="navi_table" cellspacing="0" cellpadding="0">

<tr>

<td class="menu">

<a href="http://www.travian.nl/">Home</a>

<a href="#" onclick="return Popup(0,0);">Instructies</a>

<a href="spieler.php?uid=706">Profiel</a><a href="logout.php">Log uit</a>

<a href="http://forum.travian.nl/" target="_blank">Forum</a><a href="http://www.travian.nl/chat/?chatname=nl1|706" target="_blank">Chat</a>

<a href="plus.php?id=3">Travian <b><font color="#71D000">P</font><font color="#FF6F0F">l</font><font color="#71D000">u</font><font color="#FF6F0F">s</font></b></a><a href="support.php">Support</a></td>

</tr>

</table></div><div id="lmid1"><div id="lmid2"><h1><b>Marktplaats Niveau 20</b></h1>

<p class="f10">Op de Marktplaats kan er gehandeld worden met andere spelers. Per niveau van de Marktplaats is er één handelaar beschikbaar.</p><p class="txt_menue">

<a href="build.php?id=33">Stuur grondstoffen</a> |

<a href="build.php?id=33&t=1">Kopen</a> |

<a href="build.php?id=33&t=2">Verkopen</a> | <a href="build.php?id=33&t=3">NPC Handel</a></p><script language="Javascript">

<!--

var dorfnamen = new Array("[01]Bienville Parish","[02]Ellis County","[03]Runnels County","[04]West Dallas");

//-->

</script><script language="Javascript">

<!--

var haendler = 5;

var carry = 1000;

//-->

</script><p>

<form method="POST" name="snd" action="build.php">

<input type="hidden" name="id" value="33">

<table cellspacing="0" cellpadding="0" width="100%" valign="top">

<tr valign="top">

<td width="45%">

<table class="f10">

<tr>

<td><a href="#" onclick="upd_res(1,1); return false;"><img class="res" src="img/un/r/1.gif"></a></td>

<td>Hout:</td><td align="right"><input class="fm" type="Text" name="r1" id="r1" value="" size="4" maxlength="5" onkeyup="upd_res(1)" tabindex="1"></td><td class="s7 f8"><a href="#" onmouseup="add_res(1);" onclick="return false;">(1000)</a></td>

</tr>

<tr>

<td><a href="#" onclick="upd_res(2,1); return false;"><img class="res" src="img/un/r/2.gif"></a></td>

<td>Klei:</td><td align="right"><input class="fm" type="Text" name="r2" id="r2" value="" size="4" maxlength="5" onkeyup="upd_res(2)" tabindex="2"></td><td class="s7 f8"><a href="#" onmouseup="add_res(2);" onclick="return false;">(1000)</a></td>

</tr>

<tr>

<td><a href="#" onclick="upd_res(3,1); return false;"><img class="res" src="img/un/r/3.gif"></a></td>

<td>IJzer:</td><td align="right"><input class="fm" type="Text" name="r3" id="r3" value="" size="4" maxlength="5" onkeyup="upd_res(3)" tabindex="3"></td><td class="s7 f8"><a href="#" onmouseup="add_res(3);" onclick="return false;">(1000)</a></td>

</tr>

<tr>

<td><a href="#" onclick="upd_res(4,1); return false;"><img class="res" src="img/un/r/4.gif"></a></td>

<td>Graan:</td><td align="right"><input class="fm" type="Text" name="r4" id="r4" value="" size="4" maxlength="5" onkeyup="upd_res(4)" tabindex="4"></td><td class="s7 f8"><a href="#" onmouseup="add_res(4);" onclick="return false;">(1000)</a></td>

</tr>

</table>

</td><td width="55%" valign="top">

<table class="f10">

<tr><td colspan="2">Handelaren 5/20

</td></tr>

<tr><td colspan="2"><span class="f135 b">Dorp:</span>

<input class="fm" type="Text" name="dname" value="" size="10" maxlength="20" tabindex="5" onkeyup="my_village()"></td>

</tr>

<tr><td colspan="2"><i>of</i></td></tr>

<tr>

<td colspan="2">

<span class="f135 b">

X:

<input class="fm" type="Text" name="x" value="" size="2" maxlength="4" tabindex="6">

Y:

<input class="fm" type="Text" name="y" value="" size="2" maxlength="4" tabindex="7">

</span></td>

</tr>

</table>

</td></tr>

</table><p><input type="Checkbox" name="x2" value="1" tabindex="9"> Opgegeven grondstoffen twee keer versturen</p><p><input type="image" value="ok" border="0" name="s1" src="img/nl/b/ok1.gif" width="50" height="20" onmousedown="btm1('s1','','img/nl/b/ok2.gif',1)" onmouseover="btm1('s1','','img/nl/b/ok3.gif',1)" onmouseup="btm0()" onmouseout="btm0()" tabindex="9"></input></form></p><script language="Javascript" type="text/javascript">

//<!--

document.snd.r1.focus();

//-->

</script><p>Elke handelaar kan <b>1000</b> grondstoffen dragen.</p><p class="b">Aankomende handelaren:</p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=1140"><span class="c0">misterlin</span></a></td>

<td colspan="2"><a href="karte.php?d=314358&c=dc"><span class="c0">Transport van ola2</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer1>0:31:15</span> uur</td><td>om 15:23 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">1500 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">0</td></tr></table></p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=1140"><span class="c0">misterlin</span></a></td>

<td colspan="2"><a href="karte.php?d=314357&c=54"><span class="c0">Transport van ola3</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer2>0:32:26</span> uur</td><td>om 15:24 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">1500 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">0</td></tr></table></p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=1140"><span class="c0">misterlin</span></a></td>

<td colspan="2"><a href="karte.php?d=314357&c=54"><span class="c0">Transport van ola3</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer3>0:32:32</span> uur</td><td>om 15:24 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">1500 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">0</td></tr></table></p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=1140"><span class="c0">misterlin</span></a></td>

<td colspan="2"><a href="karte.php?d=314357&c=54"><span class="c0">Transport van ola3</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer4>0:32:51</span> uur</td><td>om 15:24 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">1500 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">0</td></tr></table></p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=1140"><span class="c0">misterlin</span></a></td>

<td colspan="2"><a href="karte.php?d=314357&c=54"><span class="c0">Transport van ola3</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer5>0:33:01</span> uur</td><td>om 15:24 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">1500 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">0</td></tr></table></p><p class="b">Eigen handelaren onderweg:</p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=706"><span class="c0">Bonnie & Clyde</span></a></td>

<td colspan="2"><a href="karte.php?d=314358&c=dc"><span class="c0">Transport naar ola2</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer6>1:51:46</span> uur</td><td>om 16:43 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">0 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">3000</td></tr></table></p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=706"><span class="c0">Bonnie & Clyde</span></a></td>

<td colspan="2"><a href="karte.php?d=314357&c=54"><span class="c0">Transport naar ola3</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer7>1:54:04</span> uur</td><td>om 16:45 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">0 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">3000</td></tr></table></p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=706"><span class="c0">Bonnie & Clyde</span></a></td>

<td colspan="2"><a href="karte.php?d=314357&c=54"><span class="c0">Transport naar ola3</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer8>1:54:10</span> uur</td><td>om 16:45 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">0 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">3000</td></tr></table></p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=706"><span class="c0">Bonnie & Clyde</span></a></td>

<td colspan="2"><a href="karte.php?d=314357&c=54"><span class="c0">Transport naar ola3</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer9>1:54:29</span> uur</td><td>om 16:46 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">0 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">3000</td></tr></table></p><p><table cellspacing="1" cellpadding="2" class="tbg">

<tr class="cbg1">

<td width="21%"><a href="spieler.php?uid=706"><span class="c0">Bonnie & Clyde</span></a></td>

<td colspan="2"><a href="karte.php?d=314357&c=54"><span class="c0">Transport naar ola3</span></a></td>

</tr>

<tr><td>Aankomst</td><td><span id=timer10>1:54:39</span> uur</td><td>om 16:46 uur</td></tr>

<tr class="cbg1"><td>Grondstoffen</td><td class="s7" colspan="2"><span class="f10"><img class="res" src="img/un/r/1.gif">0 | <img class="res" src="img/un/r/2.gif">0 | <img class="res" src="img/un/r/3.gif">0 | <img class="res" src="img/un/r/4.gif">3000</td></tr></table></p><p class="c">Marktplaats is volledig uitgebouwd</p><img src="img/un/a/x.gif" /></div></div></div><div id="lright1"><a href="dorf3.php"><span class="f10 c0 s7 b">Dorpen:</span></a><table class="f10"><tr><td class="nbr"><span class="c2"></span>&nbsp; <a href="?newdid=852&gid=17&id=33" class="active_vl">LouisianaHighway 154</a></td><td class="right"><table class="dtbl" cellspacing="0" cellpadding="0">

<tr>

<td class="right dlist1">(-21</td>

<td class="center dlist2">|</td>

<td class="left dlist3">-21)</td>

</tr>

</table></td></tr><tr><td class="nbr"><span></span>&nbsp; <a href="?newdid=18151&gid=17&id=33">[01]Bienville Parish</a></td><td class="right"><table class="dtbl" cellspacing="0" cellpadding="0">

<tr>

<td class="right dlist1">(-19</td>

<td class="center dlist2">|</td>

<td class="left dlist3">-21)</td>

</tr>

</table></td></tr><tr><td class="nbr"><span></span>&nbsp; <a href="?newdid=24442&gid=17&id=33">[02]Ellis County</a></td><td class="right"><table class="dtbl" cellspacing="0" cellpadding="0">

<tr>

<td class="right dlist1">(-20</td>

<td class="center dlist2">|</td>

<td class="left dlist3">-23)</td>

</tr>

</table></td></tr><tr><td class="nbr"><span></span>&nbsp; <a href="?newdid=29760&gid=17&id=33">[03]Runnels County</a></td><td class="right"><table class="dtbl" cellspacing="0" cellpadding="0">

<tr>

<td class="right dlist1">(-19</td>

<td class="center dlist2">|</td>

<td class="left dlist3">-20)</td>

</tr>

</table></td></tr><tr><td class="nbr"><span></span>&nbsp; <a href="?newdid=35010&gid=17&id=33">[04]West Dallas</a></td><td class="right"><table class="dtbl" cellspacing="0" cellpadding="0">

<tr>

<td class="right dlist1">(-21</td>

<td class="center dlist2">|</td>

<td class="left dlist3">-22)</td>

</tr>

</table></td></tr></table><ul class="dl"></ul></div></div><div id="lres0">

<table align="center" cellspacing="0" cellpadding="0"><tr valign="top">

<td><img class="res" src="img/un/r/1.gif" title="Hout"></td>

<td id=l4 title=1000>16315/80000</td>

<td class="s7"> <img class="res" src="img/un/r/2.gif" title="Klei"></td>

<td id=l3 title=1100>16818/80000</td>

<td class="s7"> <img class="res" src="img/un/r/3.gif" title="IJzer"></td>

<td id=l2 title=1000>22057/80000</td><td class="s7"> <img class="res" src="img/un/r/4.gif" title="Graan"></td>

<td id=l1 title=1789>62357/80000</td>

<td class="s7"> &nbsp;<img class="res" src="img/un/r/5.gif" title="Graanverbruik">&nbsp;790/2579</td></tr></table>

</div><div id="ltime">Berekening in <b>13</b> ms

Servertijd: <span id="tp1" class="b">14:51:46</span> </div>

<div id="ce"></div></body>

</html>

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Okay;) I'll do that with my next postings. Thanks

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I would have done that if it was possible. The +Edit button doesn't exist under my post. It should be right next to the other buttons with + I would say (like +quote). But it isn't there...

EDIT: In this post I can edit but my first post just doesn't have the button... :S

EDIT2: We're getting a bit off topic to.

So what I tried now was the following: I let _IEproperty assign a uniqueid to my link and then use _IEaction to click on the link by defining it by _IEgetobjbyid. Looks like this:

#include <IE.au3>
$oIE = _IECreate ("http://s2.travian.nl/login.php")
Sleep (2000)
$Login = _IEGetObjByName ($oIE, "s1")
_IEAction ($Login, "click")
_IELoadWait ($oIE)
_IENavigate ($oIE, "http://s2.travian.nl/build.php?newdid=90602&gid=17&id=35")
_IELoadWait ($oIE)
$Object = _IEGetObjById ( $oIE, "ms__id23" )
_IEAction ( $Object, "click" )

Still doesn't work. It seems to me that this should work but that the Id is wrong. But why I've no idea...

Edited by Clyde

Share this post


Link to post
Share on other sites

To find the uniqueid I used this piece of code (found somewhere on this forum and edited a bit):

#include <IE.au3>
$oIE = _IEattach ("travian")
$oLinks = _IELinkGetCollection ($oIE)
$oLink = $oLinks
$iNumLinks = @extended
MsgBox(0, "Link Info", $iNumLinks & " links found")

Sleep ( "5000" )
For $oLink In $oLinks ; Cycles through every link it found
   
    Send( $oLink.href & "|" &  _IEPropertyGet($oLink, "uniqueid")) ; The URL and the label name
    If StringInStr(_IEPropertyGet($oLink, "innertext"), "Userf Forum") Then ; If it has "user forum" it's going to click the link
        _IEAction($oLink, "click") ; Click
        ExitLoop ; Exits the 'For' loop
    EndIf
   
Next

I let it type in notepad and then just took the Id from the link I needed...

Share this post


Link to post
Share on other sites

This topic can be closed because I don't expect any answers any more. I've tried it when using _IEaction "Click" but this doesn't work either.

Share this post


Link to post
Share on other sites

Take a look at my Southpark randomizer

#include <IE.au3>
#include <GUIConstants.au3>

_Randomize()

Func _Randomize()
$oIE = _IECreate("http://www.southparkzone.com/")
$oLinks = _IELinkGetCollection ($oIE)
$iNumLinks = @extended

$GetHandle = WinGetHandle("South")
WinSetState($GetHandle, "", @SW_MAXIMIZE)

For $oLink In $oLinks
    If $oLink.href="http://www.southparkzone.com/random.php" then  _IEAction($oLink, "click")
Next

_IELoadWait($oIE)

$oInputs = _IETagNameGetCollection ($oIE, "input")
For $oInput In $oInputs
    If $oInput.type="text" then ConsoleWrite($oInput.name  & "=" & $oInput.value  & @CRLF)
Next
EndFunc

AlmarM


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites

It looks nice but how should this help me click this link? I've tried _IEAction and then Click. I've found the right ID but it stil doesn't work. The problem is that the link I want to click only responses to a mouseup action. But I can't simulate this with _IEAction or an other IE function, or can I?

The problem comes down to this, how do I click this link:

<a href="#" onmouseup="add_res(1);" onclick="return false;">(1000)</a>

Because I'm able to click this link (this is the link above the link I want to click):

<a href="#" onclick="upd_res(1,1); return false;"><img class="res" src="img/un/r/1.gif"></a>

Difference is clear: the first one responses to MouseUp and the second one to onclick. I've tried clicking both links with _IEAction ($oLink, "Click"), with _IELinkClickByIndex and _IELinkClickByText and all three methods work on the second link but not one works with the first link. I've the idea that this is a bit of a insolvable problem when only using IE functions. But I'm working on another way to work around clicking this link. If anybody knows a solution that would be really great, but otherwise I'll try something else and don't use this link.

Greetings, Clyde

Share this post


Link to post
Share on other sites

I've found a way around it. I'm now using _IEBodyread to read the number that is the link. This number I can also use to fill in the form. This topic can be closed.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0