Sign in to follow this  
Followers 0
RediXe

Array Troubles

5 posts in this topic

I'm trying to code a semi-simple addon for Star Wars: The Old Republic game. They do not have an API to write addons (yet) so was hoping to create one that can be run outside the game. Might have other uses as well.

Here's the Idea:

A key combo is pressed, program will start a count down timer to show when something expires. It's a basic buff/debuff timer.

So I create a file that will have the Name of the ability, the key or combo of keys to watch for, and the duration of the buff/debuff (Who ever uses this will have to configure this file themselves but atm I am only one using it)

Sample content:

Force Breach;^{2};18\

Earth Shield;+{1};8

I tried to StringSplit with "\n" for newline but that didn't work so I made do with the \ but rather not. Maybe an empty " " would work?

I get the array that now contains: (does the array auto use [0] for array size?)

[1] Force Breach;^{2};18

[2] Earth Shield;+{1};8

What I am having trouble getting to work is turning the above into:

[1][1] Force Breach

[1][2] ^{2}

[1][3] 18

[2][1] Earth Shield

[2][2] +{1}

[2][3] 8

I'll probably have more issue's later on but this is where I am currently stuck at.

#include <File.au3>
#include <Array.au3>

; Read File watcher.txt
$sStr = FileRead("watcher.txt")

$aItems = StringSplit($sStr, "\")
Global $aList[1]

For $x = 1 To UBound($aItems)-1
    Local $aTemp = StringSplit($aItems[$x], ";")
    _ArrayAdd($aList, $aTemp)
    _ArrayDisplay($aList, "K")
Next


For $x = 1 To UBound($aList,1)
    For $y = 1 To UBound($aList,2)
        MsgBox(0, 'Record: [' & $x & '][' & $y & '] ', $aList[$x][$y])
    Next
Next

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

*herp* Forum Rules *derp*

Edited by mechaflash213

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Share this post


Link to post
Share on other sites

Please don't post in these types of threads, just report them and move on. Let the moderators point the miscreants in the right direction.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

What is wrong with this thread? Please explain.

  • Automating games or game servers. This rule is zero tolerance. Any discussion of using AutoIt to launch or interact with a game or game server violates our rules. See below for more details.
  • Scripts or programs that violate the license agreement for software. If a program explicitly says no automation, do not discuss automation of that software here.
If it's related to that I'm not trying to automate anything just trying to display a countdown when a specific key/key combo is hit on the keyboard. It's has nothing to do with the game itself, it could be a kitchen timer so when I hit "S" a timer auto starts counting down. Edited by RediXe

Share this post


Link to post
Share on other sites

RediXe,

What is wrong with this thread? Please explain

You stated from the outset that this was for use in a game - therefore it falls foul of our rules. If you wanted to code a timer for key press combinations you should have asked how to do that - mentioning that it was for a game was not the way to do it. And please do not repost the question not using the word "game" - read the rules carefully. :huh:

Anyway, thread locked. :D

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0