Jump to content

memoryoverflow

Active Members
  • Posts

    71
  • Joined

  • Last visited

Profile Information

  • Location
    The Matrix (as you've guessed)

memoryoverflow's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. I'm not a gamer so don't know these abbreviations - now waiting for Volly's comments.
  2. Hi "colors" For what game is that bot? Knowing more of the mechanics should make clearer what you want.
  3. What do you mean with 'open'? Display the contents à la dir command?
  4. You don't really tell what the String is, in which you want the replacement to occur. If it's the whole text, like: Local $sText = '$a = 55' & @CRLF & '$ab = 10' you could use Local $sChanged = StringReplace($sText, '$a ', '$b ')
  5. Whatever game that is wouldn't matter, since he explicitely states to cheat and discovery would have consequences.
  6. Hi 'C.' Sounds a bit weird. Why do you have to have the seperated lists with their repeated values in the first place? And then: The whole thing smells like a task for the embedded SQLite, doesn't it? It's certainly possible to sort it out with arrays (merging, sorting, comparing each item with its successor, delete if equal) but that doesn't really smell sensible.
  7. I'd expect strings that represent a valid number to be converted to that number and an error thrown by the conversion for all other strings. So I'd expect '5abc' to be not converted at all, neither 5 nor 0, i.e. both options don't make sense for me. <ot> Here's what I'm currently doing to get there: The degree of permissiveness is certainly subject to dicussion. (And in the above I don't allow thousand seperators, because I'd do so only after processing the locale settings as well.) </ot>
  8. Not absolutely sure what the desired result is, but... in your first pattern, you wouldn't need the null-string aternative, just a ?-quatifier (but the null alternitive spoils it anyway) in the latter particle, the aternation specifier is wrong, the charater group [] includes aternation between those charakters. So, something like Local $i = 0, $asTest[4] = ['http://www.google.com/','http://www.google.com','www.google.com','www.google.com/sub'] For $i = 0 To UBound($asTest) - 1 ConsoleWrite($asTest[$i] & ' => ' & StringRegExpReplace($asTest[$i], '(?i)(?>http\://|\A)([^/]*)(?>/\z|\z)','$1') & @crlf ) Nextwould strip the surrounds and let you work on with a unified representation. @ ResNullius: I bet that there's a simpler pattern doing the same job? edit: typos
  9. Ha, that's neat! That's what I was looking for (and it reveals the mistake I made while doing so immediately). Thanks 'ResNullius'!
  10. And here's the 1-liner, not exactly elegant, but does the job:Local $sTest = '98765432123456789' ConsoleWrite($sTest & ' = ' & StringLeft($sTest, 1 + Mod(StringLen($sTest) - 1, 3)) & StringRegExpReplace(StringMid($sTest, 2 + Mod(StringLen($sTest) - 1, 3)), '(\G\d{3})',',$1') & @crlf )
  11. Something like this? Not perfect, but should give a start: Local $sTest = '46734537' $sTest = StringRegExpReplace($sTest, '(\d{0,2})(\d{3}+)', '$1,$2$3$4') ConsoleWrite($sTest & @crlf )No, doesn't do it.
  12. And here's how to get system time into the string: If you want to use _Date_Time_GetSystemTime() (it's more efficient without): That function returns a SYSTEMTIME struct as defined in StructureConstants.au3 with the members 'Year', 'Month', 'Dow', 'Day', 'Hour', 'Minute', 'Second', 'MSeconds' You can cast that in an array and then use the first tryied methods on it or use it directly: #include <Date.au3> Local $tSysTime = _Date_Time_GetSystemTime() $sString = DllStructGetData($tSysTime, 2) & DllStructGetData($tSysTime, 4) & DllStructGetData($tSysTime, 1) ConsoleWrite($sString & @CRLF)
  13. Because he wanted system time and not local time? And this is why the other examples, too, yield wrong results.
  14. $split becomes an array in the 2nd quoted line, not a string. So the last quoted line probably doesn't do what you expect. If you really want to have what you specified in the 1st quoted line, use $split = _ArrayToString($split, '') after the 2nd quoted line. (Requires #include <array.au3>) edit: The '' in the last line are 2 single quotes, not a doublequote, specifying an empty string. Iordicast's example does the same thing easier - this was just to clarify a possible missconception of StringSplit().
  15. It is possible, but a bit complex, since it needs things like look ahead & recursion and the square brackets \[, \] make it look confusing. I don't think that someone, who doesn't have a similar pattern ready 'on his shelf', can write it in a few minutes, even with some experience.
×
×
  • Create New...