hackmud

hackmud

TypeError: ret.includes is not a function
When I call ret.includes in my script the game responds me with a message I wrote above. I use ret to save server responses when hacking the server:
ret = args.t.call(cm);
And i use it check whether the repsonse contains any substrings that I need, for example:
while (ret.includes('LOCK_ERROR'))
Any help would be appreciated!
< >
Showing 1-7 of 7 comments
The Discord (invite: BnUg8fb) is good for coding help.

I think the issue is the script being called doesn't exist (or isn't returning a string, but locs that exist will do that like 99% of the time).
Thanks for helping, yeah, I was kinda thinking earlier about the point you are making but I can't believe that an NPC world return nothing.
Got a problem too.

Here's my script call
<my_username>.c00x { t:#s.anonymous_a9te9k.p_yr2xmg }

Script is the following:

function(c, a) { // t:#s.a.e var p = a.p || {}, r = ''; r = a.t.call({}); return{ok:true, msg:r}; }

Leads to

Success { ok: false, msg: "RUNTIME ERROR anonymous_a9te9k.p_yr2xmg: script doesn't exist" }

But .match(/ERR/)
function(c, a) { // t:#s.a.e var p = a.p || {}, r = ''; r = a.t.call({}); return{ok:true, msg:r.match(/ERR/)}; }

returns an exception

:::TRUST COMMUNICATION::: TypeError: r.match is not a function
You can't regex match an object, that error is expected. Strings only.
I’ll back home and test, what func returns, cuz it looks like string for me, not an object. And test match with casted value.
Apparently, the "script being called doesn't exist" reason worked for me since I was trying to break the lock for too long with my script and someone just got ahead of me (probably, just by bruteforcing).
This is because when you try to call a script that doesn't exist, you don't get back a string but an object, something of the likes:
ok: false, msg:"blablabla error"

not sure what exactly but you can just do for(var x in a) and check the contents of your args
< >
Showing 1-7 of 7 comments
Per page: 1530 50