These are chat archives for EFox2413/initium-d

21st
Apr 2016
Vocandin
@Vocandin
Apr 21 2016 11:46 UTC
finally lol
So yeah elys, all working, Ill go figure how to make my camp names fancy now
Elliot Fox
@EFox2413
Apr 21 2016 12:29 UTC
nice job @Vocandin
let me see your code
Vocandin
@Vocandin
Apr 21 2016 12:32 UTC
1 sec

(function() {
'use strict';
var campname = ('.header-location').text;

$(document).bind('keydown', function(e) {
if (e.keyCode == 82) {
    // press the letter R
    window.location.href='ServletCharacterControl?type=createCampsite&name=camp';
}
return false;

});

})();

ignore the trash around lol, was messing with it
I wanted to make the camp name = text from the area link on top left
<div class="header-location above-page-popup">
<a href="#" style="font-size: 10px;">
Aera Countryside
</a>
</div>
'''<div class="header-location above-page-popup">
<a href="#"style="font-size: 10px;">
Aera Countryside
</a>
</div>
sorry .-. trying to send formatted lol
<div class="header-location above-page-popup"> <a href="#"style="font-size: 10px;"> Aera Countryside </a> </div>
Elliot Fox
@EFox2413
Apr 21 2016 12:54 UTC
hmmm lets see
you need to do it like this 3 backticks ```javascript and then go to next line
Vocandin
@Vocandin
Apr 21 2016 12:55 UTC
heres my code atm
Elliot Fox
@EFox2413
Apr 21 2016 12:55 UTC
var helloWorld = function() {
    console.log("Hello world!");
}
Vocandin
@Vocandin
Apr 21 2016 12:55 UTC
is it better to use jquery or pure js?
for tamper
Elliot Fox
@EFox2413
Apr 21 2016 12:55 UTC
js fanatics would tell you pure js, but jquery is fine
Vocandin
@Vocandin
Apr 21 2016 12:55 UTC
prefer jquery lol
Elliot Fox
@EFox2413
Apr 21 2016 12:56 UTC
if performance becomes an issue you can refactor
and its more readable
A solid rule of thumb to follow is to always shoot for the most readable code, and optimize if needed later
Vocandin
@Vocandin
Apr 21 2016 12:56 UTC
so, to extract the text
$('header-location a').text ();
no?
Im calling a var to use a function to extract the text on a codepen
and then got a button to alert the text for testing
it says undefined
Elliot Fox
@EFox2413
Apr 21 2016 12:58 UTC
im pretty sure code run on codepen is sandboxed
so if you type in some javascript intending to modify the website's DOM it won't be able to access it
your code looks like how i was thinking of doing it
unclear about the campname part though
why not just set the campsite name to localStorage.getItem("campsiteName");
Vocandin
@Vocandin
Apr 21 2016 13:00 UTC
I wan't variety lol
otherwise people tie camp name to me
Elliot Fox
@EFox2413
Apr 21 2016 13:01 UTC
ok so if i was to implement this type of functionality for my script for instance, i would want the ability to change the name but I wouldn't want to add anything to the dom to where you could see the name change
I wouldn't want to bind a key to it either as it increases keybinding clutter
so I would include it in my config popup menu
Vocandin
@Vocandin
Apr 21 2016 13:02 UTC
config popup menu = name popup?
Elliot Fox
@EFox2413
Apr 21 2016 13:02 UTC
popups aren't too hard to create if you hijack the native functions, and an easy way to store a name for retrieval later is to use the tampermonkey function GM_setValue
Vocandin
@Vocandin
Apr 21 2016 13:02 UTC
vocandin.exe has crashed
Elliot Fox
@EFox2413
Apr 21 2016 13:03 UTC
haha ok, in initium a pagePopup is what you see when you click on inventory or nearby items
thats what they look like
Vocandin
@Vocandin
Apr 21 2016 13:03 UTC
k
same as popup for naming camp I assume
Elliot Fox
@EFox2413
Apr 21 2016 13:04 UTC
you'd be wrong, that's not a page popup
thats a floating popup because it's above the screen
i haven't looked into the code for that
Vocandin
@Vocandin
Apr 21 2016 13:05 UTC
hummmmmm
ok
Elliot Fox
@EFox2413
Apr 21 2016 13:05 UTC
here's the code to hijack the makePopup function in script.js
    // creates a popup with HTML content
    var mkPopup = function(content) {
        // close all other popups, increment popup counter
        closePagePopup();
        currentPopupStackIndex++;
        exitFullscreenChat();

        var pagePopupId = "page-popup" + currentPopupStackIndex;

        //No elements have z-index on the combat screen, so we
        //cant have page-popup-glass there because it relies on
        //z-index to not cover everything
        var structure = "<div id='"+pagePopupId+"'><div id='" +
            pagePopupId+"-content' style='min-height:150px;' " +
            "class='page-popup'><img id='banner-loading-icon' " +
            "src='javascript/images/wait.gif' border=0/></div>" +
            "<div class='page-popup-glass'></div><a class='page-popup-X' " +
            "onclick='closePagePopup()'>X</a></div>";

        // checks if current page is doesn't have #page-popup-root
        //  and adds the needed div if it is
        if ($("#page-popup-root").length == 0) {
            $('<div id="page-popup-root"></div>').insertAfter(".chat_box");
        }

        //Create popup
        $("#page-popup-root").append(structure);

        //If chat box doesnt have z index, remove glass box
        if( $(".chat_box").css('z-index') != '1000100') {
            $(".page-popup-glass").remove();
        }

        //Fill popup with content
        $("#"+pagePopupId+"-content").html(content);

        // pressing escape will close the popup
        if (currentPopupStackIndex === 1) {
            $(document).bind("keydown",function(e) {
                if ((e.keyCode == 27)) {
                    closePagePopup();
                }
            });
        }

        // hides previous popup if there was one
        if (currentPopupStackIndex > 1) {
            $("#page-popup" + (currentPopupStackIndex-1)).hide();
        }
    };
the popup that the campsite name uses is the promptPopup() function in script.js
Vocandin
@Vocandin
Apr 21 2016 13:07 UTC
yea
I tried fiddling with it but realized the popup would persist and best way would be to just bypass it completely
Elliot Fox
@EFox2413
Apr 21 2016 13:07 UTC
the native pagePopup code is here

function pagePopup(url)
{
    if (url.indexOf("?")>0)
        url+="&ajax=true";
    else
        url+="?ajax=true";

    exitFullscreenChat();

    var stackIndex = incrementStackIndex();
    var pagePopupId = "page-popup"+stackIndex;

    $("#page-popup-root").append("<div id='"+pagePopupId+"' class='page-popup'><div id='"+pagePopupId+"-content' src='"+url+"'><img id='banner-loading-icon' src='javascript/images/wait.gif' border=0/></div></div>");
    $("#"+pagePopupId+"-content").load(url);
}
Vocandin
@Vocandin
Apr 21 2016 13:09 UTC
but that's just changing popup tho
Elliot Fox
@EFox2413
Apr 21 2016 13:09 UTC
if you want to be lazy i would advise using the mkPopup code I and consilium wrote, or try to write the equivalent yourself
what do you mean?
Vocandin
@Vocandin
Apr 21 2016 13:09 UTC
isn't it better to just extract the text from the link as I wanted and add to a name var?
Elliot Fox
@EFox2413
Apr 21 2016 13:10 UTC
the link you wanted is just a text input that saves a string to localStorage
it would be trivial to simply trigger the box to come up on a keypress
that's probably the easiest way all around
but it might interfere with native keybindings and other scripts
which might not be something you should worry about right now
Vocandin
@Vocandin
Apr 21 2016 13:11 UTC
k gimme a few mins gotta do some stuff
Elliot Fox
@EFox2413
Apr 21 2016 13:11 UTC
kk im going to eat as well
Vocandin
@Vocandin
Apr 21 2016 13:40 UTC
alright
I am quite noob on all this so take your time lol
I don't see where you are going with changing the popup when I just want to avoid it
Elliot Fox
@EFox2413
Apr 21 2016 13:58 UTC

just finished the better call saul finale... anyways about the popups

There are two main reasons to use a pagePopup instead of a promptPopup
1.) A prompt is using for yes or no questions or submit / cancel but it's not particularly necessary in this case
2.) The code of the game uses pagePopups for almost everything and the only thing it uses a prompt for is this one scenario

You are currently avoiding it fine by bypassing the popup, however we were discussing how to implement a function to change the campsite name
Vocandin
@Vocandin
Apr 21 2016 14:05 UTC
damn I should watch it lol, missed last few eps
so I want to set campsite name from the html I sent
as it will change wherever I go
the point is still make a function to bypass popup and act as campsite hotkey for easy camp making
Elliot Fox
@EFox2413
Apr 21 2016 14:07 UTC
huh what will change?
you want to change the name of your campsite for each page?
Vocandin
@Vocandin
Apr 21 2016 14:08 UTC
the top left link
that says Aera Countryside says so because I was there
if I was in the desert it would say desert
thus creating a Camp: Desert
Elliot Fox
@EFox2413
Apr 21 2016 14:08 UTC
oh thats what you meant with the header id code
I thought you meant as a way to share the script and let other people change the names to what they wanted
so my responses were according to that usecase
Vocandin
@Vocandin
Apr 21 2016 14:10 UTC
nah :P
goddam emojis lol
Elliot Fox
@EFox2413
Apr 21 2016 14:11 UTC
ahhhh when you first posted the code i kind of skipped the html part of it
my bad
Vocandin
@Vocandin
Apr 21 2016 14:11 UTC
no worries
Elliot Fox
@EFox2413
Apr 21 2016 14:11 UTC
simple fix your jquery filter was $( 'header-location a' )
but since the class is header-location and not the element you need to write it as '.header-location a'
that . means its a class
im guessing it was a typo and you already know that
Vocandin
@Vocandin
Apr 21 2016 14:13 UTC
yea
fixed here
then I did this

```(function() {
'use strict';
var name = function() {
$('.header-location a').text();
};

$(document).bind('keydown', function(e) {
if (e.keyCode == 82) {
    // press the letter R
    window.location.href='ServletCharacterControl?type=createCampsite&name=' + name;
}
return false;

});

})();```

welp idk why it won't select the full code but it's there
when I create a camp it says it has to be 1-40 long
Elliot Fox
@EFox2413
Apr 21 2016 14:15 UTC
you need 3 backticks followed by javascript like so ```javascript then you should press enter and paste the code in between the two backtick lines
Vocandin
@Vocandin
Apr 21 2016 14:15 UTC
ohhh#
Elliot Fox
@EFox2413
Apr 21 2016 14:15 UTC
```javascript
code
```
Vocandin
@Vocandin
Apr 21 2016 14:16 UTC

```javascript (function() {
'use strict';
var name = function() {
$('.header-location a').text();
};

$(document).bind('keydown', function(e) {
if (e.keyCode == 82) {
    // press the letter R
    window.location.href='ServletCharacterControl?type=createCampsite&name=' + name;
}
return false;

});

})();```

Elliot Fox
@EFox2413
Apr 21 2016 14:16 UTC
nope your function cannot be on the same line
Vocandin
@Vocandin
Apr 21 2016 14:16 UTC
k
```javascript
Elliot Fox
@EFox2413
Apr 21 2016 14:16 UTC
umm try shift enter
sorry
and ctrl enter to send
Vocandin
@Vocandin
Apr 21 2016 14:17 UTC
a
now I cant press enter only anymore lol
nvm fixed
(function() {
    'use strict';
    var name =  function() {
  $('.header-location a').text();
    };

    $(document).bind('keydown', function(e) {
    if (e.keyCode == 82) {
        // press the letter R
        window.location.href='ServletCharacterControl?type=createCampsite&name=' + name;
    }
    return false;
});

})();
Elliot Fox
@EFox2413
Apr 21 2016 14:17 UTC
alright!
you know $( '.header-location' ).text(); might work
oh wait
i see why it's undefined
Vocandin
@Vocandin
Apr 21 2016 14:18 UTC
it's not undefined anymore
An error occured
Camp name must be between 1 and 40 characters long.
Elliot Fox
@EFox2413
Apr 21 2016 14:19 UTC
var name = function() {
    $( '.header-location a').text();
};
console.log(name();)
console returned: "";
can you tell why?
your function has no return value
Vocandin
@Vocandin
Apr 21 2016 14:20 UTC
no .-.
hummm
Elliot Fox
@EFox2413
Apr 21 2016 14:20 UTC
try var name = $( '.header-location a').text();
you don't need to make it a function
Vocandin
@Vocandin
Apr 21 2016 14:21 UTC
did it
damn
my first really useful script
Elliot Fox
@EFox2413
Apr 21 2016 14:21 UTC
:D
Vocandin
@Vocandin
Apr 21 2016 14:21 UTC
I was doing it right at first but didn't think it was right cause codepen
reason why I thought I had to make .text a function or it wouldn't work
nice
Elliot Fox
@EFox2413
Apr 21 2016 14:22 UTC
i see
Vocandin
@Vocandin
Apr 21 2016 14:22 UTC
will keep fiddling to see what else I could make
btw
a suggestion
you probably realized shop system is totally meh
Elliot Fox
@EFox2413
Apr 21 2016 14:23 UTC
nope
Vocandin
@Vocandin
Apr 21 2016 14:23 UTC
each time you list something it refreshes all your inventory
Elliot Fox
@EFox2413
Apr 21 2016 14:23 UTC
i literally have never used it
Vocandin
@Vocandin
Apr 21 2016 14:24 UTC
its ok for few items
Elliot Fox
@EFox2413
Apr 21 2016 14:24 UTC
just kind of wanted to play the game without interacting with other players haha...
Vocandin
@Vocandin
Apr 21 2016 14:24 UTC
but when it gets 100+ it lags for anything inventory related
Elliot Fox
@EFox2413
Apr 21 2016 14:24 UTC
but i should look into it probably
Vocandin
@Vocandin
Apr 21 2016 14:24 UTC
My idea would be
you have items in the screen
and a textbox beside it
you put all prices and anything above 0 will be listed when you press ok
and to remove item you could simply have a checkbox and select them
Im sure ID would do it but priorities
shop items aren't even grouped by type, totally random, weird margins between items
total mess
Elliot Fox
@EFox2413
Apr 21 2016 14:26 UTC
from what i can tell ID is starting to get more hands off with this project
Vocandin
@Vocandin
Apr 21 2016 14:26 UTC
as in going away from it? lol
Elliot Fox
@EFox2413
Apr 21 2016 14:26 UTC
I'd bet that he's planning for nike to inherit it and take care of most coding and design decisions
bu
t thats purely speculation
Vocandin
@Vocandin
Apr 21 2016 14:27 UTC
humm
Elliot Fox
@EFox2413
Apr 21 2016 14:27 UTC
ID got a hefty loan for the development of voidspace if he doesn't see some serious capital returns from that venture he will be hurting
Vocandin
@Vocandin
Apr 21 2016 14:27 UTC
yea ive read about it
makes sense
Elliot Fox
@EFox2413
Apr 21 2016 14:27 UTC
I would bet that 90% of his time is on that front
if you look at the github repo it's pretty much all nike with ID reviewing commits and merging them
Vocandin
@Vocandin
Apr 21 2016 14:28 UTC
how is the public code working out?
wheres it?
link please?
Elliot Fox
@EFox2413
Apr 21 2016 14:28 UTC
I wouldn't describe it as public, but more of a quasi public where they keep all dev details hidden in the slack chat and just have the code open
I'm unwilling to contribute to it at this point based on my first pull request that was pretty much testing the waters to see how ID would react
Emperorlou/initium-odp#1
Vocandin
@Vocandin
Apr 21 2016 14:30 UTC
I see
well, I hope ID isn't gone
Elliot Fox
@EFox2413
Apr 21 2016 14:31 UTC
frankly the codebase is such a mess I wouldn't do anything besides refactoring at this point
Vocandin
@Vocandin
Apr 21 2016 14:31 UTC
as nike can do content really well but is a really stubborn person
Elliot Fox
@EFox2413
Apr 21 2016 14:31 UTC
It's quite strange that they have such a contrast between their Java code and their JavaScript, in Java they have documentation for every function
I see
I don't know either of them that well
Vocandin
@Vocandin
Apr 21 2016 14:32 UTC
a TL:DR would be nike only see right and wrong
there isn't inbetween
but anyway
it seems messy as hell yea
as I don't even know where Im going lol
Elliot Fox
@EFox2413
Apr 21 2016 14:33 UTC
I won't broach the subject with ID, i think it would just offend him if I did
that's why I just gave up on it instead and focus on my other projects
Vocandin
@Vocandin
Apr 21 2016 14:34 UTC
sucks cause Im sure youd do some serious progress
Elliot Fox
@EFox2413
Apr 21 2016 14:34 UTC
haha maybe so, but in the end the prospect of studying about some other subjects and creating my own projects will eventually be too alluring to resist
Vocandin
@Vocandin
Apr 21 2016 14:35 UTC
haha
Elliot Fox
@EFox2413
Apr 21 2016 14:35 UTC
anyways I hope that you will code lots, I want to see you grow haha
and submit your code so I can look over it in case i can give you tips
Vocandin
@Vocandin
Apr 21 2016 14:36 UTC
will surely do
Im going back to finishing my portfolio v2.0
Elliot Fox
@EFox2413
Apr 21 2016 14:37 UTC
man.... i gotta find a job soon... haha
Vocandin
@Vocandin
Apr 21 2016 14:37 UTC
gotta make a lightbox and wanted to try a jquery approach instead of css
Elliot Fox
@EFox2413
Apr 21 2016 14:37 UTC
im moving back from thailand to indiana in the US
Vocandin
@Vocandin
Apr 21 2016 14:37 UTC
nice!
you were born in bangkok or something?
Elliot Fox
@EFox2413
Apr 21 2016 14:37 UTC
ooo a webportfolio, i should make one of those too
nah i just came here to teach for a year to explore a different country a bit
Vocandin
@Vocandin
Apr 21 2016 14:37 UTC
I see
Elliot Fox
@EFox2413
Apr 21 2016 14:37 UTC
jeez being born in the us makes it a lot easier to get back there you know
haha
Vocandin
@Vocandin
Apr 21 2016 14:37 UTC
any experience good or bad adds value
Elliot Fox
@EFox2413
Apr 21 2016 14:38 UTC
true
Vocandin
@Vocandin
Apr 21 2016 14:39 UTC
As I always avoided js I learned way more css
and just do anything I want with just css lol
it's lighter anyway
Elliot Fox
@EFox2413
Apr 21 2016 14:39 UTC
yeah im the opposite
know nothing about css so i avoid it mainly
Vocandin
@Vocandin
Apr 21 2016 14:39 UTC
I'm sure most would go jquery cause easier
Elliot Fox
@EFox2413
Apr 21 2016 14:39 UTC
honestly i hate webdev, but like JS
divs never behave properly
Vocandin
@Vocandin
Apr 21 2016 14:41 UTC
haha
it's second nature to me lol
Elliot Fox
@EFox2413
Apr 21 2016 14:41 UTC
nice, that means you got a lot of experience with it
Vocandin
@Vocandin
Apr 21 2016 14:41 UTC
I see a lot of fun jquery stuff, but nothing that can't be replaced by css or would be useful
Elliot Fox
@EFox2413
Apr 21 2016 14:41 UTC
I'll ask you if i have questions
Vocandin
@Vocandin
Apr 21 2016 14:41 UTC
np, we will help each other
I was looking into getting a github rep
Elliot Fox
@EFox2413
Apr 21 2016 14:42 UTC
jquery isn't about replacing CSS but it's about creating HTML on the fly and having the DOM adjust to changes
Vocandin
@Vocandin
Apr 21 2016 14:42 UTC
but will do for next project instead
Elliot Fox
@EFox2413
Apr 21 2016 14:42 UTC
yeah you should
learning git will help your portfolio also
and it's amazing
Vocandin
@Vocandin
Apr 21 2016 14:42 UTC
from what I've read
git is useful, github is personal opinion
Elliot Fox
@EFox2413
Apr 21 2016 14:43 UTC
yeah github is just you know a server for your git
Vocandin
@Vocandin
Apr 21 2016 14:43 UTC
version control is hell of a skill to have
Elliot Fox
@EFox2413
Apr 21 2016 14:43 UTC
github is amazing but git is the real thing
its like comparing a webpage to HTML, JS, Jquery, and CSS
Vocandin
@Vocandin
Apr 21 2016 14:43 UTC
will using just github make me good at git or totally different?
Elliot Fox
@EFox2413
Apr 21 2016 14:43 UTC
it will
but don't download their client or if you do, try to do everything from the command line
if you learn through the command line you will learn it properly and it will stick with you
Vocandin
@Vocandin
Apr 21 2016 14:44 UTC
I see, will do
thats for git right?
Elliot Fox
@EFox2413
Apr 21 2016 14:44 UTC
their GUI makes it too easy, and then if you get a job that uses git you will be lost without it
yeah
what do you use as an IDE/programming environmnet?
Vocandin
@Vocandin
Apr 21 2016 14:45 UTC
yeah I always preferred to do it on the hard way so I can just coast when I really need haha
at the moment nothing, because personal projects
so nothing too big to need it
Elliot Fox
@EFox2413
Apr 21 2016 14:45 UTC
so textpad?
wordpad?
Vocandin
@Vocandin
Apr 21 2016 14:45 UTC
I use sublime for coding
Elliot Fox
@EFox2413
Apr 21 2016 14:45 UTC
ok that's what i meant
haha
Vocandin
@Vocandin
Apr 21 2016 14:45 UTC
sorry lol went over my head
Elliot Fox
@EFox2413
Apr 21 2016 14:46 UTC
so the thing about any programming environments is that they are made my programmers
and programmers like plugins
Vocandin
@Vocandin
Apr 21 2016 14:48 UTC
I totally should check my sublime plugins
thing is a monster lol
I just use vanilla for now
Elliot Fox
@EFox2413
Apr 21 2016 14:48 UTC
^^
and if you want the complete sadism impossible level difficulty level of coding try to learn vim or emacs
Vocandin
@Vocandin
Apr 21 2016 14:49 UTC
lol
Elliot Fox
@EFox2413
Apr 21 2016 14:49 UTC
largely derided as not worth the time investment but once you reach proficiency you grow a beard and will never again walk the path of the other editors
Vocandin
@Vocandin
Apr 21 2016 14:49 UTC
I don't want sadism at all
just going with most useful/ used
Elliot Fox
@EFox2413
Apr 21 2016 14:49 UTC
it is the most useful you fool!!!
haha i use vim
Vocandin
@Vocandin
Apr 21 2016 14:50 UTC
lol
Elliot Fox
@EFox2413
Apr 21 2016 14:50 UTC
at first it's like relearning how to use a computer though
Vocandin
@Vocandin
Apr 21 2016 14:51 UTC
my goal is to get pretty good on jquery, finish my new portfolio, learn illustrator, learn git
then idk
Elliot Fox
@EFox2413
Apr 21 2016 14:51 UTC
no javascript?
:P
Vocandin
@Vocandin
Apr 21 2016 14:51 UTC
thats on jquery haha
learning both as I go
I see
Vocandin
@Vocandin
Apr 21 2016 14:53 UTC
I see
sublime was my first and never tried another
read about couple good ones
but doesn't seem worth my time for now
Elliot Fox
@EFox2413
Apr 21 2016 14:53 UTC
I'd stick with sublime
they're all the same, and thankfully have vim plugins
besides once you start getting into configuration you'll waste hours in frustration on it and won't learn anything
Vocandin
@Vocandin
Apr 21 2016 14:54 UTC
lol
Ive found this
    $('#lightbox').live('click', function() { 
        $('#lightbox').hide();
    });
only useful thing from the jquery lightbox I was trying out
.live means all page I assume
as in, whatever #lightbox is showing up
Elliot Fox
@EFox2413
Apr 21 2016 14:55 UTC
oh
.live is deprecated in 1.7 use .on
Vocandin
@Vocandin
Apr 21 2016 14:57 UTC
alright
reading on as well
will switch it over
Elliot Fox
@EFox2413
Apr 21 2016 15:19 UTC
damn i wonder if there's a way to do this without doing the split after the reduce function
var duckArray = ['duck', 'duck', 'duck', 'goose', 'duck'];

var uniqFowl = duckArray.sort()
  .reduce(function(a, b) {
    if (a === b) {
      return a;
    } else {
      return a + ',' + b;
    }
  }).split(',');

console.log(uniqFowl);
some Functional Programming JS you might not have seen
Vocandin
@Vocandin
Apr 21 2016 15:25 UTC
why the split tho
looks alright without it but then again I know nothing
Elliot Fox
@EFox2413
Apr 21 2016 15:25 UTC
I want an array of the unique names, and the reduce function will strip it down to a single string
wait a second i dont think that code works
Vocandin
@Vocandin
Apr 21 2016 15:26 UTC
lol
Elliot Fox
@EFox2413
Apr 21 2016 15:27 UTC
dammit
or maybe i could just make a into an array..
Vocandin
@Vocandin
Apr 21 2016 15:29 UTC
right now it's making first two strings into a and b, then replacing B with whatever till array is done right
Elliot Fox
@EFox2413
Apr 21 2016 15:30 UTC
yeah b is always the next index in the array and a is always the previous
Vocandin
@Vocandin
Apr 21 2016 15:33 UTC
neat
I may try fixing shop interface for now
Elliot Fox
@EFox2413
Apr 21 2016 15:34 UTC
yeah go for it
Vocandin
@Vocandin
Apr 21 2016 15:34 UTC
so I can price everything first then list all on one button
Elliot Fox
@EFox2413
Apr 21 2016 15:34 UTC
oh and at the end of reduce it returns whatever a is
Vocandin
@Vocandin
Apr 21 2016 15:37 UTC
humm
function storeSellItem(itemId)
{
    promptPopup("Sell Item", "How much do you want to sell this item for?", "0", function(confirm){
        window.location.href="ServletCharacterControl?type=storeSellItem&itemId="+itemId+"&amount="+confirm;
    });
}
the way it works doesn't seem to support what I was thinking without major rework
from reading this I understand why ninja kept trying shenanigans on players rofl
one time I made someone who was low on hp attack a boss through links lol
I didn't think it would work
Elliot Fox
@EFox2413
Apr 21 2016 15:41 UTC
hmmm im surprised it did
Vocandin
@Vocandin
Apr 21 2016 15:41 UTC
attacks doesn't even hide the link
Elliot Fox
@EFox2413
Apr 21 2016 15:41 UTC
you know that function is for when you are setting the price right?
Vocandin
@Vocandin
Apr 21 2016 15:41 UTC
yes
Elliot Fox
@EFox2413
Apr 21 2016 15:41 UTC
and it sends the information to the server for storage
Although if ninja got someone to click a crafted link and he had their itemid I can see it being abused in that way
maybe i should set up as a conartist
well I knew the shop stuff would be a kind of major thing (100+ lines) but i think you could improve it sufficiently
Vocandin
@Vocandin
Apr 21 2016 15:44 UTC
don't think Ill make progress in a small time like a week lol
ninja made a buy item link straight into his shop
had leather stuff for 400ks
he clicked himself and his money was gone
Elliot Fox
@EFox2413
Apr 21 2016 15:44 UTC
what's wrong with that? in terms of your first line
Vocandin
@Vocandin
Apr 21 2016 15:44 UTC
nothing wrong
idk if you see my idea
as you never tried shop lol
right now you click the sell button on an item, it popups to input price, you press ok it then refreshes the whole inventory
this is the cause of lag
my idea was
Elliot Fox
@EFox2413
Apr 21 2016 15:45 UTC
I mean if the page shows the price on items you should be able to collect all the info and have that total price
Vocandin
@Vocandin
Apr 21 2016 15:46 UTC
Id have no popup
just boxes to input
then a single ok button
Elliot Fox
@EFox2413
Apr 21 2016 15:46 UTC
yeah ok
Vocandin
@Vocandin
Apr 21 2016 15:46 UTC
I can see the code structure in my mind, but huuge rework
Elliot Fox
@EFox2413
Apr 21 2016 15:46 UTC
the way I would go about doing that would be to desynchronize the client's webpage with the server's state
submit the httprequest but don't refresh the page
and then submit however many more
then when they hit the ok button you refresh the page
it would be bad if you saved all of those http requests to be submit at the same time though
Vocandin
@Vocandin
Apr 21 2016 15:47 UTC
hummm
also sucks that it would go all down the drain when shop finally gets the attention it needs
Elliot Fox
@EFox2413
Apr 21 2016 15:48 UTC
but you could do something like on textinput focused then unfocused send the http request, without the client page changing
that's just the nature of scripting though
Vocandin
@Vocandin
Apr 21 2016 15:48 UTC
haha
Ill work my way to it
Elliot Fox
@EFox2413
Apr 21 2016 15:48 UTC
the things that last are your knowledge gained from it, and the positive experience you gave to people using the script
Vocandin
@Vocandin
Apr 21 2016 15:49 UTC
sadly Im feeling more likely to trick people into stuff lol
Elliot Fox
@EFox2413
Apr 21 2016 15:49 UTC
how's that?
if you have malicious code in the scripts, it will get found out and your reputation will sink
Vocandin
@Vocandin
Apr 21 2016 15:49 UTC
like the attack boss I did
noo
nothing like that
I meant jokes
Elliot Fox
@EFox2413
Apr 21 2016 15:50 UTC
yeah im all for jokes though and exploits
Vocandin
@Vocandin
Apr 21 2016 15:50 UTC
like toggle chat fullscreen and stuff
Elliot Fox
@EFox2413
Apr 21 2016 15:50 UTC
but I don't think there's a whole lot you can do to other players without convincing them to click a link
Vocandin
@Vocandin
Apr 21 2016 15:50 UTC
If I managed to get the campsite without popup
means I could make people drop inventory lol
Elliot Fox
@EFox2413
Apr 21 2016 15:50 UTC
how's that?
Vocandin
@Vocandin
Apr 21 2016 15:51 UTC
any function that ends up in a link
"ServletCharacterControl?type=requestLeaveGroup"
you make link
Elliot Fox
@EFox2413
Apr 21 2016 15:51 UTC
but you'd be relying on them clicking it
Vocandin
@Vocandin
Apr 21 2016 15:51 UTC
mask it and done
it's not hard
Elliot Fox
@EFox2413
Apr 21 2016 15:51 UTC
which is a poor way to do an exploit
since it's easy to find the victomizer
Vocandin
@Vocandin
Apr 21 2016 15:51 UTC
well, gives them an option lol
Elliot Fox
@EFox2413
Apr 21 2016 15:52 UTC
true
oh here's some trivia for you
Vocandin
@Vocandin
Apr 21 2016 15:52 UTC
I wouldn't make a script with hidden stuff just to mess people
Elliot Fox
@EFox2413
Apr 21 2016 15:52 UTC
how many possibilities do you think there are for id's in the game? locationIds itemids things like that
Vocandin
@Vocandin
Apr 21 2016 15:52 UTC
harm in a no cool way
location, items, characters, shops...
I saw something about another location one
that we don't see
so 5 with that
think everything else fits into those categories
Elliot Fox
@EFox2413
Apr 21 2016 15:54 UTC
nah i mean like the number
Vocandin
@Vocandin
Apr 21 2016 15:55 UTC
ohhh
2 092 278 989 000
max characters is 16 from what i've seen
Elliot Fox
@EFox2413
Apr 21 2016 15:57 UTC
hehe but it's actually more like 16777215
Vocandin
@Vocandin
Apr 21 2016 15:57 UTC
lol
how?
Elliot Fox
@EFox2413
Apr 21 2016 15:58 UTC
if you convert the numbers to binary youll see a pretty simple pattern
it will show you the bits of the number that are actually random
which is 30 bits or 2^30 - 1
but then it appears as though 6 additional bits are used as some sort of id from what i can tell, which would make it 2^24 - 1
16,777,215
Vocandin
@Vocandin
Apr 21 2016 15:59 UTC
I see
fun fact of the day it seems lol
Elliot Fox
@EFox2413
Apr 21 2016 16:00 UTC
yeah
it probably wouldn't be impossible to crack if i put in some hours, and if i collected a lot of id's but I haven't been that interested in doing it
Vocandin
@Vocandin
Apr 21 2016 16:00 UTC
to what purpose?
Elliot Fox
@EFox2413
Apr 21 2016 16:01 UTC
you could see every item that exists, every monster that exists (maybe), go to every house that exists, know every location
Vocandin
@Vocandin
Apr 21 2016 16:01 UTC
locations are different now
before you could input ID into url and "discover"
now only houses works that way
Elliot Fox
@EFox2413
Apr 21 2016 16:02 UTC
I don't know about the discover, i have never died so never got the chance to try it
Vocandin
@Vocandin
Apr 21 2016 16:02 UTC
I used it to get alts into shrines
as they are annoying to find
Elliot Fox
@EFox2413
Apr 21 2016 16:02 UTC
mmhmm
Vocandin
@Vocandin
Apr 21 2016 16:02 UTC
and impossible on anything but sunny day
Elliot Fox
@EFox2413
Apr 21 2016 16:02 UTC
so it doesn't work wit hteh servlet url
did you try the command in the console?
Vocandin
@Vocandin
Apr 21 2016 16:03 UTC
haven't yet
did you see ninja did a big exploit lately?
stealing items from mobs? lol
wonder how he did it
Elliot Fox
@EFox2413
Apr 21 2016 16:04 UTC

oh it appears for my previous problem that filter is what you use instead of reduce

var duckArray = ['duck', 'duck', 'duck', 'goose', 'duck', 'duck', 'goose', 'swan'];

var uniqFowl = duckArray.sort().filter(function(entry, i, array) {
        if (!i) {
            return true;
        }
        return entry != array[i - 1];
    })

console.log(uniqFowl);

returns ["duck", "goose", "swan"]

hmm no i hadn't seen that
wow that !i looks confusing as hell
Vocandin
@Vocandin
Apr 21 2016 16:04 UTC
lol
Elliot Fox
@EFox2413
Apr 21 2016 16:06 UTC
var duckArray = ['duck', 'duck', 'duck', 'goose', 'duck', 'duck', 'goose', 'swan'];

var uniqFowl = duckArray.sort().filter(function(entry, i, array) {
        // true if i is 0, or entry is not a duplicate of the previous value
        return !i || entry != array[i - 1];
    })

console.log(uniqFowl);
it's so beautiful :' )
Vocandin
@Vocandin
Apr 21 2016 16:07 UTC
lol
gtg now
Elliot Fox
@EFox2413
Apr 21 2016 16:07 UTC
me too, time to sleep
Vocandin
@Vocandin
Apr 21 2016 16:07 UTC
see ya later
Elliot Fox
@EFox2413
Apr 21 2016 16:07 UTC
see you