Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hello, wizards! Is there anybody know JS script in CCB to find specific word in .txt file? And if this word is present in the .txt file => do something For example, i just need to make LOGIN system. User will enter Login, and if this login is present in .txt file from my server => he must enter password, password is next string in .txt => if login and password correct => also read from this file next strings, like "money", "level" => just change scene => play with variables from your account |
||||
|
There is already a plugin by @Just_in_case is available to download which reads a single line of string from a text file. You can download the plugin from ambiera's extensions page. Hope that helps. |
||||
|
In addition to my previous post there is also a simple login and signup example provided by the same guy named as @Just_in_case is available on the forums all you have to do is to crawl the forums |
||||
|
Here is the link to login and signup example https://www.ambiera.com/forum.ph... |
||||
|
Thanks for answer :) But that is not what im looking for. I need script or plugin to FIND SPECIFIC WORD in .txt file |
||||
|
intriguing question... behold my attempt to solve part of the riddle using string match method! var FileName= "datafile.txt" maybe that method could be useful for you. |
||||
|
Thank you tim12345! This is almost what i mean! But... this script is read isn't full word as correct... For example: When login word is "USER" it accept this as correct But even i type "USE","US" or "U" It also accept this as correct This is strange Can you fix this? Please |
||||
|
hm... this seems to be more complex than I originally thought! what if you were to encase the LoginName in the .txt file with say an x, like so: xLoginNamex then we modify the script a bit... var FileName= "datafile.txt" would that fix it? |
||||
|
Nope... For now it just accept all words as correct Im not a programmer, for me its look like a magic |
||||
|
ah darn! it seems to work for me. oh well, i tried! hopefully someone knows of a better way. |
||||
|
I can make a small extension that can search for a specific word in a file so you can use it as a coppercube extension, for those who are uncomfortable with programming, However, it will be put on the backburner because I am developing my own extension right now. Its on my todo list, though. So, don't worry about not finding a solution. |
||||
|
@tim12345 - Anyway, thank you for trying @xanimalkingx - I would be very grateful, at the moment I am also busy with my project, I think I can postpone this part of the project for a while! |
|