Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(x < 64)
- {
- //Take this room name, convert the number to decimal, delete the integers from the name and finally substract 10 from the integer
- thisroom = room_get_name(room);
- thisroomdec = real(string_char_at(thisroom,9)) * 10 + real(string_char_at(thisroom, 10));
- thisroom = string_delete(thisroom,9,2)
- thisroomdec -= 10;
- //if the next room is smaller than 10, add a 0 before the string
- if(thisroomdec < 10)
- {
- thisroom = string_insert(string(0),thisroom,9);
- thisroom = string_insert(string(thisroomdec),thisroom,10);
- }
- else
- {
- thisroom = string_insert(string(thisroomdec),thisroom,9);
- }
- for(i = 0; i < 100; i += 1)
- {
- if(thisroom == string(room_get_name(i)))
- {room_goto(i);}
- }
- }
- if(x > (room_width - 64))
- {
- //Take this room name, convert the number to decimal, delete the integers from the name and finally add 10 to the integer
- thisroom = room_get_name(room);
- thisroomdec = real(string_char_at(thisroom,9)) * 10 + real(string_char_at(thisroom, 10));
- thisroom = string_delete(thisroom,9,2)
- thisroomdec += 10;
- //if the next room is smaller than 10, add a 0 before the string
- if(thisroomdec < 10)
- {
- thisroom = string_insert(string(0),thisroom,9);
- thisroom = string_insert(string(thisroomdec),thisroom,10);
- }
- else
- {
- thisroom = string_insert(string(thisroomdec),thisroom,9);
- }
- for(i = 0; i < 100; i += 1)
- {
- if(thisroom == string(room_get_name(i)))
- {room_goto(i);}
- }
- }
- if(y < 128)
- {
- //Take this room name, convert the number to decimal, delete the integers from the name and finally add 1 to the integer
- thisroom = room_get_name(room);
- thisroomdec = real(string_char_at(thisroom,9)) * 10 + real(string_char_at(thisroom, 10));
- thisroom = string_delete(thisroom,9,2)
- thisroomdec += 1;
- //if the next room is smaller than 10, add a 0 before the string
- if(thisroomdec < 10)
- {
- thisroom = string_insert(string(0),thisroom,9);
- thisroom = string_insert(string(thisroomdec),thisroom,10);
- }
- else
- {
- thisroom = string_insert(string(thisroomdec),thisroom,9);
- }
- for(i = 0; i < 100; i += 1)
- {
- if(thisroom == string(room_get_name(i)))
- {room_goto(i);}
- }
- }
- if(y > room_height - 128)
- {
- //Take this room name, convert the number to decimal, delete the integers from the name and finally substract 1 from the integer
- thisroom = room_get_name(room);
- thisroomdec = real(string_char_at(thisroom,9)) * 10 + real(string_char_at(thisroom, 10));
- thisroom = string_delete(thisroom,9,2)
- thisroomdec -= 1;
- //if the next room is smaller than 10, add a 0 before the string
- if(thisroomdec < 10)
- {
- thisroom = string_insert(string(0),thisroom,9);
- thisroom = string_insert(string(thisroomdec),thisroom,10);
- }
- else
- {
- thisroom = string_insert(string(thisroomdec),thisroom,9);
- }
- for(i = 0; i < 100; i += 1)
- {
- if(thisroom == string(room_get_name(i)))
- {room_goto(i);}
- }
- }
Add Comment
Please, Sign In to add comment