Snippet ASCII Object Id converter

Laiev

Hey Listen!!
Reaction score
188
This forum's search should be really improved

No, should not :p

TheHelper is an updated forum (from vBulletin 3.8.5 or so to 4.1.5), the only thing that could be 'wrong' is if old vBulletin way to index topics was different then actual, but this should be fixed when updated, so probably some mistake on configuration or something wrong when you try to search something (I never have problem with vB search engine).

This is not the point of the topic, sorry about this >.<
 

tooltiperror

Super Moderator
Reaction score
231
The search function is fine, it's probably the user who has the problem.

Narrow down your search to the T&R section. Then search for "ascii" and it comes up with the two Ascii snippets on the very first page.

As it seems this is less efficient and practically reinvents the wheel with absolutely no added bonus, I'm going to send this to the graveyard unless you can provide a reason otherwise.

But nonetheless, a good job :)
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
I didn't knew anything about ascii, I just saw some things when trying to see what makes sense with these numbers on WE debug messages.
I just figured out what is it, searched post, didn't find anything. typing ascii snippet came up with save-load systems, and didn't find anything.

The other guys, have more experience from me in programming and I would say you should graveyard this, if the others are really better.
Because only my ObjId2S function has same speed as theirs....I only know mathematics so S2ObjId is not in my power do this through function and not with loop search as I did now.

Is "integer = 5/3" same with "integer i = R2I(5/3)" ??
I haven't got answer yet.
 

Jedi

New Member
Reaction score
63
Yes same, you can test it you know :D

Also why would he search something like "Ascii", I would probably search things like "object id convert", "object integer" things like that.

Edit:I searched Object id convert and found damien's ascii.
 

tooltiperror

Super Moderator
Reaction score
231
To the graveyard I banish this resource, never to return again (unless it becomes worthy of redemption)!
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
tooltiperror:
1. (unless it becomes worthy of redemption)!
2. I'm going to send this to the graveyard unless you can provide a reason otherwise. ... But nonetheless, a good job.

1. What does that suppose to mean? (Are you writing a knights novel? All your posts (in this thread) have absolute zero information of how NoobImbaPro could try to improve his snippet [what's up with that])

2. Yeah good job to him, and I think poor job of you.
 

Jedi

New Member
Reaction score
63
He was just talking with nice-funny words wtf.What could he say to improve this snippet?It converts object id to string that is it.
 

tooltiperror

Super Moderator
Reaction score
231
Because, regardless of how he improved it, it was just a clone of another resource, and therefore useless.
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
tooltiperror:
1. Because, regardless of how he improved it, it was just a clone of another resource, and therefore useless.

1. Then why bullsh*ting him ("Perhaps you could make a demomap showing many uses of Ascii functions, and then submit it with a brief introduction to how it works?") to spend even more time on this snippet?

Jedi:
1. He was just talking with nice-funny words wtf.

1. Unfortunately language is full of "nice-funny" words that don't have any communication value, he could instead try to come right to the point on his first post with "Because, regardless of how he improved it, it was just a clone of another resource, and therefore useless." (that's better).
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
Stop helping me, It's my fault, but thanks anyway. This snippet it is as you see it, and as I see it will become a clone of another snippet by making it better. You can't make anything faster than currect ASCII snipepts, or more useful, or something else...

**All your posts (in this thread) have absolute zero information of how NoobImbaPro could try to improve his snippet

And in AUMS too
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
NoobImbaPro:
1. You can't make anything faster than currect ASCII snipepts,

1. Are you sure? [this was 'copied' from Toadcop's BX-TRSII map =)]

JASS:
globals
    string  I2A_result = &quot;&quot;
    integer I2A_int = 0
    string array ASCII
endglobals

function init_ascii takes nothing returns nothing
    set ASCII[32] = &quot; &quot;
    ...
    set ASCII[65] = &quot;A&quot;
    ...
    set ASCII[90] = &quot;Z&quot;
    set ASCII[97] = &quot;a&quot;
    ...
    set ASCII[122] = &quot;z&quot;
    ...
endfunction

constant function ModuloInt takes integer h, integer d returns integer
     return  h - (h / d) * d
endfunction

function sub_I2A takes nothing returns nothing
    local integer i = I2A_int
    set I2A_result = ASCII[i / 0x1000000] + ASCII[ModuloInt(i / 0x10000, 0x100)] + ASCII[ModuloInt(i / 0x100, 0x100)] + ASCII[ModuloInt(i, 0x100)]
endfunction

// &#039;/usr&#039; -&gt; &quot;/usr&quot;
function I2A takes integer a returns string
    set I2A_int = a
    call ExecuteFunc(sub_I2A)
    return I2A_result
endfunction


JASS:
globals
    hashtable ascii      = InitHashtable()
    integer   A2I_result =  0
    string    A2I_string = &quot;&quot;
endglobals

function init_ascii takes nothing returns nothing
    call SaveInteger(ascii, 0x100, StringHash(&quot; &quot;), 32)
    ...
    call SaveInteger(ascii, 0x100, StringHash(&quot;A&quot;), 65)
    ...
    call SaveInteger(ascii, 0x100, StringHash(&quot;Z&quot;), 90)
    call SaveInteger(ascii, 0x100, StringHash(&quot;a&quot;), 97)
    ...
    call SaveInteger(ascii, 0x100, StringHash(&quot;z&quot;), 122)
    ...
endfunction

function sub_A2I takes nothing returns nothing
    local strign s = A2I_string
    set A2I_result = LoadInteger(ascii, 256, StringHash(SubString(s, 0, 1))) * 0x1000000 + \
                     LoadInteger(ascii, 256, StringHash(SubString(s, 1, 2))) * 0x10000   + \
                     LoadInteger(ascii, 256, StringHash(SubString(s, 2, 3))) * 0x100     + \
                     LoadInteger(ascii, 256, StringHash(SubString(s, 3, 4)))
endfunction

// &quot;/bin&quot; -&gt; &#039;/bin&#039;
function A2I takes string a returns integer
    set A2I_string = a
    call ExecuteFunc(&quot;sub_A2I&quot;)
    return A2I_result
endfunction
 

Nestharus

o-o
Reaction score
84
That's not as good. It could potentially be faster for 4 char ascii codes specifically (only integer to ascii), but the drawback is that you'd only be able to pass in 4 char ascii codes (instead of any number of characters). Keep in mind that valid wc3 ascii codes are 1 char or 4 chars.

The ascii to integer is just plainly not as good as the methods on this site.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top