[SOLVED]Help. How to read external .txt from github

Status
Not open for further replies.

Bilalichwa

Veteran
Veteran
Joined
May 12, 2017
Messages
33
Reaction score
9
First Language
Indonesia
Primarily Uses
RMMV
i watch how to read from text file in local file


and I want to know, how to read the txt file that is on github


I tried it but it failed.


var ASWERD = "http://raw.githubusercontent.com/bilalichwa/revillage/master/ver.txt";

var zzz = new XMLHttpRequest();

zzz.open("GET",ASWERD,false);

zzz.send(null);

var fileContent = zzz.responseText;



if(fileContent === "200") {

$gameVariables.setValue(173, 1);

}
is there a way to read the txt file from github?

thx...
 

Zevia

Veteran
Veteran
Joined
Aug 4, 2012
Messages
640
Reaction score
353
First Language
English
Primarily Uses
RMMV
In that case, "zzz.responseText" is:
Code:
"200
"
There's a new line in there somewhere, maybe a "\n" character or something. So it's not technically equal to "200".

Try:
Code:
if (fileContent.trim() === '200')
for your conditional.
 

Bilalichwa

Veteran
Veteran
Joined
May 12, 2017
Messages
33
Reaction score
9
First Language
Indonesia
Primarily Uses
RMMV
In that case, "zzz.responseText" is:
Code:
"200
"
There's a new line in there somewhere, maybe a "\n" character or something. So it's not technically equal to "200".

Try:
Code:
if (fileContent.trim() === '200')
for your conditional.
Error like this ..
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,254
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
YEP_CoreEngine is getting in the way.
disable it just for testing.
 

Bilalichwa

Veteran
Veteran
Joined
May 12, 2017
Messages
33
Reaction score
9
First Language
Indonesia
Primarily Uses
RMMV
YEP_CoreEngine is getting in the way.
disable it just for testing.
Thanks...

its work when i disable YEP_CoreEngine..

but how is it so that the script can run with Yep_CoreEngine ?
 

Bilalichwa

Veteran
Veteran
Joined
May 12, 2017
Messages
33
Reaction score
9
First Language
Indonesia
Primarily Uses
RMMV
I remove script in lane 1844-1857 YEP_CoreEngine,, and WORKS !.

// Script
Game_Interpreter.prototype.command355 = function() {
var script = this.currentCommand().parameters[0] + '\n';
while (this.nextEventCode() === 655) {
this._index++;
script += this.currentCommand().parameters[0] + '\n';
}
try {
eval(script);
} catch (e) {
Yanfly.Util.displayError(e, script, 'SCRIPT CALL ERROR');
}
return true;
};
is it ok?
can it affect other plugins or scripts if this is deleted
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,254
Reaction score
1,254
First Language
Spanish
Primarily Uses
RMVXA
*looks* like it's only a control routine to report any errors to Yanfly's own engine.
should work fine without it, but you wouldn't get any reports of actual errors by Yanfly's plugins.
 

Bilalichwa

Veteran
Veteran
Joined
May 12, 2017
Messages
33
Reaction score
9
First Language
Indonesia
Primarily Uses
RMMV
*looks* like it's only a control routine to report any errors to Yanfly's own engine.
should work fine without it, but you wouldn't get any reports of actual errors by Yanfly's plugins.
ok thanks....
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,867
Reaction score
5,240
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,455
Members
137,821
Latest member
Capterson
Top