ID:948271
 
Keywords: etc, hacking, laptop
(See the best response by Kidpaddle45.)
Problem description:
So in my game, I want to incorporate a hacking system.

I want all laptops and computers to give off some sort of signal that reaches a specific reach of oview.

If you have a laptop, and you're in range of another laptop, you can pick up on that network.

How would I go about coding this?

Is it network like in their connection?
or network as a var in your game? O.O

Cuz if you're talking about real internet connection,you will not get any help to do this.
lol No no not a real network.
I want the laptop in game, to give off a "signal" that reaches, say, 8 tiles away.
If your user is in range of those 8 tiles, It shows you a list.
You can choose from that list to either view that person info or you can attempt to hack them in game. (Not real)
Best response
Ok i get it, the way you said it in your 1st post sounded like you wanted to hack a player's connection.xD
Didn't test but,try something like this?


obj
var
Security=0
mob
verb
HackLaptop(obj/laptops/L in oview(8))
if(L.Security==0)
switch(input("Are you sure you want to hack this laptop?","Hack?",text) in list("Yes","No"))
if("Yes")
usr<<"Retrieving Data..."
usr<<"Access Granted!"

It's working, the only problem is an indentation error which I'm getting no matter where I put it.

Here's what my code looks like.

laptop
icon = 'obj.dmi'
icon_state = "laptop"
verb
Get()
set src in oview(1)
src.loc = usr.contents
if(Move(usr))
usr << "You get [src]."
else
usr << "You are unable to get [src]"
View_Networks()
set src in usr.contents
Hack(obj/laptops/L in oview(8))
set src in usr.contents
if(L.Security==0)
switch(input("Are you sure you want to hack this laptop?","Hack?",text) in list("Yes","No"))
if("Yes")
usr<<"Retrieving Data..."
usr<<"Access Granted!")
if("No")
return
usr << "Booting"
sleep(10)
usr << "........"
sleep(10)
usr << "Logging In"
sleep(10)
usr << "........"
sleep(10)
usr << "[usr] has logged in"


obj.dm:266:error: inconsistent indentation
obj.dm:267:error: inconsistent indentation
obj.dm:268:error: inconsistent indentation
obj.dm:269:error: inconsistent indentation
obj.dm:270:error: inconsistent indentation
obj.dm:271:error: inconsistent indentation

Bebop Universe.dmb - 6 errors, 0 warnings (double-click on an error to jump to it)




EDIT
Hahaha it worked. I just had to take the "S" out of "Laptops". Thank you so much, man
You should try set src in view(8,src) instead of obj/laptops/L in oview(8).

And the errors you recieved are as they say, indentation errors. Just go over and re-indent everything to ensure it's correct.
The indentation errors went away after I took the "s" out of "Laptops" which is incredibly weird.
Yeah since your object wasnt called "laptops" it was called "laptop" =D. Since no object in your codes was called "laptops" it was searching for an object that doesn't exist!

Have a nice day!
Thanks for the help, both of you.
Keep in mind when you get indentation errors, that they are most of the time mistakes in the object/mob or turf you're calling. Its case sensitive,a capital letter or a spelling mistake can cause this!

No prob! =D
In response to NNAAAAHH
Lucky you,you got the best answer vote.
-_-'
aw shucks guis. Stop it.

As a general question, to stay on topic, is it possible to assign a key combination, or open up a small window where the user has to type something specific in?

Well, it's stupid to say Impossible. I guess I'm asking if you've got any ideas as to what the best way to approach that would be.
It sounds relatively easy.
In response to Raivu
It would've been better for you to open up another topic asking for help on that matter. You can make a key combination using rand() or pick() and a list of text, numbers, and symbols.

var/list/usable=list("a","b","c")
var/list/usable=list("a","A","b","B","c","C")//for case-sensitive
var/list/usable=list("1","a","2","b","3","c")
var/list/usable=list("!","a","@","b","#","c")
var/list/usable=list("1","!","2","@","3","#")


Then calling a prompt for them to enter displayed text.

mob/var/displayedtext
mob/proc/matchtext()
while(lentext(displayedtext)<6)//whatever you want the length to be
displayedtext+=//either place pick(usable) or usable[rand(1,usable.len)] -- not sure which works better.
//display the text in any way you wish here using displayedtext
var/t=input("What is the text diplayed to you?","Matchtext") as text
if(cmptext(displayedtext,t))//or cmptextEx for case-sensitive
//include whatever you need after this



@Kidpaddle45 - I'm not helping out to get points to be one of the 'most helpful' users. It's just something I do to help.
Points? O.o
Does it calculate? or is it just a way to make it easier to find the best answer in a long topic???
http://www.byond.com/forum/?forum=8

See Most Helpful Users above the forum posts.

It makes finding the solution in a large thread easier, but also adds up a total and show them on the page.

Some people are crazy about it others not so cray cray.

I voted your answer NNAAAAHH.
Oh,first time hearing about this. Sounds cool =D.
Alright Thanks a lot!
In response to A.T.H.K
Lol, everytime I get drawn back to this, there's a random change in what's voted up.
Lol oh well ....