Sign in to follow this  
Followers 0
UndeadHarlequin

Are there Mistakes in the Aray?

14 posts in this topic

Wrote my first 2 dimension-Array. in the beginning everything seams to work but f now it s** :-/

Windows sends n error "au3 found a problem,. send/not send" (in german;-) The text is standard one)

CODE
dim $b[3][6]

; Titel

$b[0][0]=Execute(FileReadLine("Instinfos.txt",10))

; Text

$b[0][1]=Execute(FileReadLine("Instinfos.txt",11))

; Zeile

$b[0][2]=Execute(FileReadLine("Instinfos.txt",12))

; Spalte

$b[0][3]=Execute(FileReadLine("Instinfos.txt",13))

; Anzahl zu löschende Zeichen.

$b[0][4]=Execute(FileReadLine("Instinfos.txt",14))

; String der eingesetzt wird.

$b[0][5]=Execute(FileReadLine("Instinfos.txt",15))

;-------------------------------------------------------------------

$b[1][0]=Execute(FileReadLine("Instinfos.txt",18))

$b[1][1]=Execute(FileReadLine("Instinfos.txt",19))

$b[1][2]=Execute(FileReadLine("Instinfos.txt",20))

$b[1][3]=Execute(FileReadLine("Instinfos.txt",21))

$b[1][4]=Execute(FileReadLine("Instinfos.txt",22))

$b[1][5]=Execute(FileReadLine("Instinfos.txt",23))

;--------------------------------------------------------------------

$b[2][0]=Execute(FileReadLine("Instinfos.txt",26))

$b[2][1]=Execute(FileReadLine("Instinfos.txt",27))

$b[2][2]=Execute(FileReadLine("Instinfos.txt",28))

$b[2][3]=Execute(FileReadLine("Instinfos.txt",29))

$b[2][4]=Execute(FileReadLine("Instinfos.txt",30))

$b[2][5]=Execute(FileReadLine("Instinfos.txt",31))

;--------------------------------------------------------------------

MsgBox(1,$b[0][0],$:mellow:

-------------------------------------------- The instalinfos.txt

Dies Ist eine Installationsinformation. Das ändern der Datei könnte zu Fehlern führen, so komplex ist´s jedoch auch nicht

InstallationsOrt:(Eingabe als zielverzeichniss: "c:/programme",. WICHTIG"")

CODE
@ProgramFilesDir&"\Spiele\UltimaOnline\"&$b

Servername:(Eingabe nach Wunsch "" nicht vergessen)

@computername&"-Server"

Charname:

@username

Zu öffnende Datein//Text//Zeile//Spalte//Zu löschende Zeichen//String:--------------------

Servername:

ServerList.cs

using System;

41

41

8

$b1

--------------------------

Willkommensgruß:

LoginStats.cs

using System;

22

20

102

$d1

--------------------------

Autosave:

AutoSave.cs

using System;

10

50

14

$e1&$f1

Where are mistakes? it seames to me, like it´s absolutly clean!!!

Perhaps you can help me!!

Share this post


Link to post
Share on other sites



Wrote my first 2 dimension-Array. in the beginning everything seams to work but f now it s** :-/

Windows sends n error "au3 found a problem,. send/not send" (in german;-) The text is standard one)

CODE
dim $b[3][6]

; Titel

$b[0][0]=Execute(FileReadLine("Instinfos.txt",10))

; Text

$b[0][1]=Execute(FileReadLine("Instinfos.txt",11))

; Zeile

$b[0][2]=Execute(FileReadLine("Instinfos.txt",12))

; Spalte

$b[0][3]=Execute(FileReadLine("Instinfos.txt",13))

; Anzahl zu löschende Zeichen.

$b[0][4]=Execute(FileReadLine("Instinfos.txt",14))

; String der eingesetzt wird.

$b[0][5]=Execute(FileReadLine("Instinfos.txt",15))

;-------------------------------------------------------------------

$b[1][0]=Execute(FileReadLine("Instinfos.txt",18))

$b[1][1]=Execute(FileReadLine("Instinfos.txt",19))

$b[1][2]=Execute(FileReadLine("Instinfos.txt",20))

$b[1][3]=Execute(FileReadLine("Instinfos.txt",21))

$b[1][4]=Execute(FileReadLine("Instinfos.txt",22))

$b[1][5]=Execute(FileReadLine("Instinfos.txt",23))

;--------------------------------------------------------------------

$b[2][0]=Execute(FileReadLine("Instinfos.txt",26))

$b[2][1]=Execute(FileReadLine("Instinfos.txt",27))

$b[2][2]=Execute(FileReadLine("Instinfos.txt",28))

$b[2][3]=Execute(FileReadLine("Instinfos.txt",29))

$b[2][4]=Execute(FileReadLine("Instinfos.txt",30))

$b[2][5]=Execute(FileReadLine("Instinfos.txt",31))

;--------------------------------------------------------------------

MsgBox(1,$b[0][0],$:(

-------------------------------------------- The instalinfos.txt

Dies Ist eine Installationsinformation. Das ändern der Datei könnte zu Fehlern führen, so komplex ist´s jedoch auch nicht

InstallationsOrt:(Eingabe als zielverzeichniss: "c:/programme",. WICHTIG"")

CODE
@ProgramFilesDir&"\Spiele\UltimaOnline\"&$b

Servername:(Eingabe nach Wunsch "" nicht vergessen)

@computername&"-Server"

Charname:

@username

Zu öffnende Datein//Text//Zeile//Spalte//Zu löschende Zeichen//String:--------------------

Servername:

ServerList.cs

using System;

41

41

8

$b1

--------------------------

Willkommensgruß:

LoginStats.cs

using System;

22

20

102

$d1

--------------------------

Autosave:

AutoSave.cs

using System;

10

50

14

$e1&$f1

Where are mistakes? it seames to me, like it´s absolutly clean!!!

Perhaps you can help me!!

Well, you can't display an array in a MsgBox() like that. Use the _ArrayDisplay() UDF.

As for the rest, your sample file has 29 lines, and you are trying to read line 31. If that's just a typo, you will still have to do something to verify that the Execute() functions are receiving the strings you expect, like:

#include <Array.au3>

Dim $b[3][6]
For $x = 0 To 2
    For $y = 0 To 5
        $iLine = ($x * 8) + $y + 10
        $sString = FileReadLine("Instinfos.txt", $iLine)
        ConsoleWrite("Debug:  Line " & $iLine & " = " & $sString & @LF)
        $b[$x][$y] = Execute($sString)
    Next
Next
_ArrayDisplay($b, "$b")

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

I tryed to replace,.. i deleted msgbox,..

I´m affraid, but it still causes an error!!:-/

!!

i forgot 2 lines in the instinfos.txt

All the other systems work.

After the error my opera laags a bit.,. i had to delet profile,.

Cann you help me more?

Share this post


Link to post
Share on other sites

I tryed to replace,.. i deleted msgbox,..

I´m affraid, but it still causes an error!!:-/

!!

i forgot 2 lines in the instinfos.txt

All the other systems work.

After the error my opera laags a bit.,. i had to delet profile,.

Cann you help me more?

Did you run something like what I posted? What did you get? Is your loop reading the lines you expect?

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Hm ,.. i Run your script,.. and i deleted te msgbox in my script,..

but both are causing an error,.. (look at the jpg,. sry I´m still german, but I´m sure u know the Layout;-))

My "new" code looks like:

CODE
dim $b[3][7]

; Titel

$b[0][0]=Execute(FileReadLine("Instinfos.txt",10))

; Text

$b[0][1]=Execute(FileReadLine("Instinfos.txt",11))

; Zeile

$b[0][2]=Execute(FileReadLine("Instinfos.txt",12))

; Spalte

$b[0][3]=Execute(FileReadLine("Instinfos.txt",13))

; Anzahl zu löschende Zeichen.

$b[0][4]=Execute(FileReadLine("Instinfos.txt",14))

; String der eingesetzt wird.

$b[0],[5]=Execute(FileReadLine("Instinfos.txt",15))

#cs

;-------------------------------------------------------------------

$b[1][0]=Execute(FileReadLine("Instinfos.txt",18))

$b[1][1]=Execute(FileReadLine("Instinfos.txt",19))

$b[1][2]=Execute(FileReadLine("Instinfos.txt",20))

$b[1][3]=Execute(FileReadLine("Instinfos.txt",21))

$b[1][4]=Execute(FileReadLine("Instinfos.txt",22))

$b[1][5]=Execute(FileReadLine("Instinfos.txt",23))

;--------------------------------------------------------------------

$b[2][0]=Execute(FileReadLine("Instinfos.txt",26))

$b[2][1]=Execute(FileReadLine("Instinfos.txt",27))

$b[2][2]=Execute(FileReadLine("Instinfos.txt",28))

$b[2][3]=Execute(FileReadLine("Instinfos.txt",29))

$b[2][4]=Execute(FileReadLine("Instinfos.txt",30))

$b[2][5]=Execute(FileReadLine("Instinfos.txt",31))

;--------------------------------------------------------------------

#ce

exit

(so i nearly comanded out everything,.. just to test, if it causes an error again,.. and it does!!)

Thx 4 your help. Perhaps there is a system error, and i need to format winpartition and need to set it up againOo???

post-38857-1227016666_thumb.jpg

Share this post


Link to post
Share on other sites

Hm ,.. i Run your script,.. and i deleted te msgbox in my script,..

but both are causing an error,.. (look at the jpg,. sry I´m still german, but I´m sure u know the Layout;-))

(so i nearly comanded out everything,.. just to test, if it causes an error again,.. and it does!!)

; ...<snip>

Thx 4 your help. Perhaps there is a system error, and i need to format winpartition and need to set it up againOo???

Sounds like you have bigger problems. If AutoIt is crashing hard with the code commented out in the script, you need to look at more basic system maintenance: completely uninstall then reinstall AutoIt and SciTE, up-to-date virus scan, etc.

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

hmm I reinstaled autoitv3

This vers(its easy,.. but not so inteligent like yours) i tryed

CODE
dim $b[3][7]

; Titel

$b[0][0]=Execute(FileReadLine("Instinfos.txt",10))

; Text

$b[0][1]=Execute(FileReadLine("Instinfos.txt",11))

; Zeile

$b[0][2]=Execute(FileReadLine("Instinfos.txt",12))

; Spalte

$b[0][3]=Execute(FileReadLine("Instinfos.txt",13))

; Anzahl zu löschende Zeichen.

$b[0][4]=Execute(FileReadLine("Instinfos.txt",14))

; String der eingesetzt wird.

$b[0],[5]=Execute(FileReadLine("Instinfos.txt",15))

exit

Same error.. every other script still works.

-.- WHY there is no reason,.. can i send both files to you?

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Funny thing: i tested it step by step!!

dim $b[3][7]

; Titel

$b[0][0]=Execute(FileReadLine("Instinfos.txt",10))

Untill here, it works without this error!!!!!

The next line causes an error:($b[0][1]=Execute(FileReadLine("Instinfos.txt",11)))

The both lines look similar!!

NOW ITS GONA BE FUNNY!!

I decied to use mightybrain.exe

: the only different is:

line10 is a textstring

executing line11 means to execute a-number

I deleted "execute" in front of "filereadline("infos.txt,11)"

Script looked like this

CODE

dim $b[3][7]

; Titel

$b[0][0]=Execute(FileReadLine("Instinfos.txt",10))

; Text

$b[0][1]=FileReadLine("Instinfos.txt",11)

IT WORKED!!!!

But now there is the master quesion for you,..

WHAT THE F***????

Why is that???

I need the number,.. not the number as a string:-/

Will it work??(and will I ever learn to speak english?^^)

Edited by UndeadHarlequin

Share this post


Link to post
Share on other sites

Full txt

(in copy by uploaded file)

I tryed filrereadline without execute, and tested if it is now a string,.. it is:-/ in this case i nore can convert,.neither i can use the string it givesback,..

CODE
Dies Ist eine Installationsinformation. Das ändern der Datei könnte zu Fehlern führen, so komplex ist´s jedoch auch nicht

InstallationsOrt:(Eingabe als zielverzeichniss: "c:/programme",. WICHTIG"")

@ProgramFilesDir&"\Spiele\UltimaOnline\"&$b

Servername:(Eingabe nach Wunsch "" nicht vergessen)

@computername&"-Server"

Charname:

@username

Zu öffnende Datein//Text//Zeile//Spalte//Zu löschende Zeichen//String:--------------------

Servername:

ServerList.cs

using System;

41

41

8

$b1

--------------------------

Willkommensgruß:

LoginStats.cs

using System;

22

20

102

$d1

--------------------------

Autosave:

AutoSave.cs

using System;

10

50

14

$e1&$f1

Instinfos.txt

Share this post


Link to post
Share on other sites

Full txt

(in copy by uploaded file)

I tryed filrereadline without execute, and tested if it is now a string,.. it is:-/ in this case i nore can convert,.neither i can use the string it givesback,..

So, lines 10 thru 15 are:
ServerList.cs
using System;
41
41
8
$b1

What did you expect Execute() to do with "ServerList.cs" and "using System"?

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Ahh hmm,.. good,.. it seams i need to tell the whole project;-) there4 it could be usefull to know what Ultima Online is.

There is a new server, runing via c#, named: RunUO

Homepage 4 more Infos:

http://www.runuo.com/

--------------------------------

The autoitscript of mine should build up the server, without loosing much time.

Becouse uo is a very old game, you need to change some details in .cs(c# scripts) files,.. like your name of the server,..or how often ther should be a "worldsave"

I´d like to build up a server,.. but there 4 some"one" need to design the world. It is hard to design it stepby step without any help..

The point is: i want to make it easy creating a homeserver and designing the world(so in the instalation there are some other desgining tools,. namedpandorasbox,.. michelangel and so on)

Al this scripts should be installed as fast as possible,. and when i finished this project, i´d like to share this "tool" with the 2 mainpages of runuo(2nd one is german;-))

What the serverlist.cs does: there i can change the servername

this file looks like:

CODE
using System;

using System.IO;

using System.Net;

using System.Net.Sockets;

using Server;

using Server.Network;

namespace Server.Misc

{

public class ServerList

{

/*

* The default setting for Address, a value of 'null', will use your local IP address. If all of your local IP addresses

* are private network addresses and AutoDetect is 'true' then RunUO will attempt to discover your public IP address

* for you automatically.

*

* If you do not plan on allowing clients outside of your LAN to connect, you can set AutoDetect to 'false' and leave

* Address set to 'null'.

*

* If your public IP address cannot be determined, you must change the value of Address to your public IP address

* manually to allow clients outside of your LAN to connect to your server. Address can be either an IP address or

* a hostname that will be resolved when RunUO starts.

*

* If you want players outside your LAN to be able to connect to your server and you are behind a router, you must also

* forward TCP port 2593 to your private IP address. The procedure for doing this varies by manufacturer but generally

* involves configuration of the router through your web browser.

*

* ServerList will direct connecting clients depending on both the address they are connecting from and the address and

* port they are connecting to. If it is determined that both ends of a connection are private IP addresses, ServerList

* will direct the client to the local private IP address. If a client is connecting to a local public IP address, they

* will be directed to whichever address and port they initially connected to. This allows multihomed servers to function

* properly and fully supports listening on multiple ports. If a client with a public IP address is connecting to a

* locally private address, the server will direct the client to either the AutoDetected IP address or the manually entered

* IP address or hostname, whichever is applicable. Loopback clients will be directed to loopback.

*

* If you would like to listen on additional ports (i.e. 22, 23, 80, for clients behind highly restrictive egress

* firewalls) or specific IP adddresses you can do so by modifying the file SocketOptions.cs found in this directory.

*/

public static readonly string Address = null;

public static readonly string ServerName = "RunUO TC";

public static readonly bool AutoDetect = true;

public static void Initialize()

{

if ( Address == null ) {

if ( AutoDetect )

AutoDetection();

}

else {

Resolve( Address, out m_PublicAddress );

}

EventSink.ServerList += new ServerListEventHandler( EventSink_ServerList );

}

private static IPAddress m_PublicAddress;

private static void EventSink_ServerList( ServerListEventArgs e )

{

try

{

NetState ns = e.State;

Socket s = ns.Socket;

IPEndPoint ipep = (IPEndPoint)s.LocalEndPoint;

IPAddress localAddress = ipep.Address;

int localPort = ipep.Port;

if ( IsPrivateNetwork( localAddress ) ) {

ipep = (IPEndPoint)s.RemoteEndPoint;

if ( !IsPrivateNetwork( ipep.Address ) && m_PublicAddress != null )

localAddress = m_PublicAddress;

}

e.AddServer( ServerName, new IPEndPoint( localAddress, localPort ) );

}

catch

{

e.Rejected = true;

}

}

private static void AutoDetection()

{

if ( !HasPublicIPAddress() ) {

Console.Write( "ServerList: Auto-detecting public IP address..." );

m_PublicAddress = FindPublicAddress();

if ( m_PublicAddress != null )

Console.WriteLine( "done ({0})", m_PublicAddress.ToString() );

else

Console.WriteLine( "failed" );

}

}

private static void Resolve( string addr, out IPAddress outValue )

{

if ( IPAddress.TryParse( addr, out outValue ) )

return;

try {

IPHostEntry iphe = Dns.GetHostEntry( addr );

if ( iphe.AddressList.Length > 0 )

outValue = iphe.AddressList[iphe.AddressList.Length - 1];

}

catch {

}

}

private static bool HasPublicIPAddress()

{

IPHostEntry iphe = Dns.GetHostEntry( Dns.GetHostName() );

IPAddress[] ips = iphe.AddressList;

for ( int i = 0; i < ips.Length; ++i )

if ( !IsPrivateNetwork( ips ) )

return true;

return false;

}

private static bool IsPrivateNetwork( IPAddress ip )

{

// 10.0.0.0/8

// 172.16.0.0/12

// 192.168.0.0/16

if ( Utility.IPMatch( "192.168.*", ip ) )

return true;

else if ( Utility.IPMatch( "10.*", ip ) )

return true;

else if ( Utility.IPMatch( "172.16-31.*", ip ) )

return true;

else

return false;

}

private static IPAddress FindPublicAddress()

{

try {

WebRequest req = HttpWebRequest.Create( "http://www.runuo.com/ip.php" );

req.Timeout = 15000;

WebResponse res = req.GetResponse();

Stream s = res.GetResponseStream();

StreamReader sr = new StreamReader( s );

IPAddress ip = IPAddress.Parse( sr.ReadLine() );

sr.Close();

s.Close();

res.Close();

return ip;

} catch {

return null;

}

}

}

}

----------------------------

---------------------------

---------------------------

(sry,.. it isnt allowed to load it up)

What the Array should read is: wich file to read,. Wich line to find,. wich colom to find,.. howmany character to delet,. and after all,.. what to send(missing 4 now).

Share this post


Link to post
Share on other sites

Ahh hmm,.. good,.. it seams i need to tell the whole project;-) there4 it could be usefull to know what Ultima Online is.

There is a new server, runing via c#, named: RunUO

Homepage 4 more Infos:

http://www.runuo.com/

--------------------------------

The autoitscript of mine should build up the server, without loosing much time.

Becouse uo is a very old game, you need to change some details in .cs(c# scripts) files,.. like your name of the server,..or how often ther should be a "worldsave"

I´d like to build up a server,.. but there 4 some"one" need to design the world. It is hard to design it stepby step without any help..

The point is: i want to make it easy creating a homeserver and designing the world(so in the instalation there are some other desgining tools,. namedpandorasbox,.. michelangel and so on)

Al this scripts should be installed as fast as possible,. and when i finished this project, i´d like to share this "tool" with the 2 mainpages of runuo(2nd one is german;-))

What the serverlist.cs does: there i can change the servername

this file looks like:

(sry,.. it isnt allowed to load it up)

What the Array should read is: wich file to read,. Wich line to find,. wich colom to find,.. howmany character to delet,. and after all,.. what to send(missing 4 now).

The Execute() function only works in the context of AutoIt functions and syntax. Those lines are not valid AutoIt syntax, so what you were trying to do simply won't work.

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

AHHHH

,.. AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

AHHHH

*chrcrhmm* AHHHHHHHHHHHHHHHHHHHH

Icq# 159300112

Any otheroptions i can use? (with an external file)

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